AgE 2.4 : Sample XML configuration

The code listing below is taken form the Hello World example (org.jage.student.examples-applications/src/main/resources/examples/helloworld/age.xml). On the right side there is a short description of every element located in it.

age.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://age.iisg.agh.edu.pl/AgE/2.5"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://age.iisg.agh.edu.pl/AgE/2.5 http://age.iisg.agh.edu.pl/xsd/age-2.5.xsd">

    <component name="workplaceManager" class="org.jage.pico.PicoWorkplaceManager" isSingleton="true">

        <component name="addressProvider" class="org.jage.address.provider.DefaultAgentAddressProvider"
            isSingleton="true"/>

        <list name="workplaces">

            <agent name="workplace" class="org.jage.workplace.IsolatedSimpleWorkplace">

                <property name="nameInitializer">
                    <value value="TheXFiles" class="String" />
                </property>

                <list name="agents">

                    <agent name="scully" class="org.jage.examples.helloworld.HelloWorldSimpleAgent">
                        <property name="nameInitializer">
                            <value value="Scully" class="String" />
                        </property>
                    </agent>
                    <reference target="scully" />

                    <agent name="mulder" class="org.jage.examples.helloworld.HelloWorldSimpleAgent">
                        <property name="nameInitializer">
                            <value value="Mulder" class="String" />
                        </property>
                    </agent>
                    <reference target="mulder" />

                </list>

                <property name="agents">
                    <reference target="agents" />
                </property>

            </agent>
            <reference target="workplace" />

        </list>

        <property name="workplaces">
            <reference target="workplaces" />
        </property>

    </component>

    <component name="stopCondition" class="org.jage.workplace.FixedStepCountStopCondition"
        isSingleton="true">
        <constructor-arg>
            <value class="Long" value="20" />
        </constructor-arg>
    </component>

</configuration>
Description


The configuration preamble for the version 2.5 of the configuration schema.



The workplace manager - the default available implementation: PicoWorkplaceManager.

The agent address provider - the default implementation.


A beginning of the list of workplaces.

The IsolatedSimpleWorkplace workplace.

A name initialization value "TheXFiles". This will be a part of the workplace address.

A beginning of the list of agents in the workplace.


The agent of the type HelloWorldSimpleAgent with the name initialization value set to "Scully".







The second agent of the type HelloWorldSimpleAgent with the name initialization value set to "Mulder".








A binding of the list of agents to the workplace property named agents.







A binding of the list of workplaces to the workplace manager property named workplaces.





A stop condition based on the number of steps performed by the system. This example will have performed 20 steps before the computation is finished.