<agents path="bin" filter="\<package\>.\<ClassNameOfAgentClassToLog\>"/>
<context id="SocialContext"> <projection id="SocialNetwork" type="network"/> </context>
See PaRma-Docs on how to configure RS in order to use ParMa with RS batch runs.
As discussed in ParMa's introduction each parameter set is associated with an unique parameter-set-ID. Therefore, each uses parameter set should be inserted as a row in the DB's main parameter table. There are at least two ways to insert multiple rows for batch runs into the table:
There is an R script /templates/paramCreation/tmpl_create_mainParameters.r in the R-Scripts collection (from revision 264 on) to insert parameter set rows by iterating over defined parameter ranges. See that script for further instructions.
Of course, it is also possible to create an Excel-spreadsheet of parameter rows and import it into the DB, for instance using Toad (Tools > Import > Import Wizard...). It is often a good idea to export rows of the parameter table into an Excel-spreadsheet, adapt the data and import it back.
Some settings need to be adapted in order to adapt the number and distribution of milieu groups:
PmParameterManager.setParameter(GMilieuPa.MILIEUS, new MilieuKeysMap());
Eclipse uses launch configurations to define classpath, main method to call, JVM parameters, etc. It is a good practice to store these launch configurations. Choose menu Run > Run Configurations... and select the configuration you want to store in the project folder > Tab Common > Save as > Shared File and choose the destination folder (usually ./config/launcher).
When creating a new model run configuration it is most appropriate to choose a launch configuration that RS automatically creates and adapt it:
<model name="KUBUS_PopDyn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://repast.org/scenario/user_path"> <classpath> <entry path="../../../lib" /> <entry path="../../../bin"/> <entry path="bin" annotations="false" ></entry> <agents path="../../../bin" filter="agents.AbstractHousehold" /> <agents path="../../../bin" filter="contexts.MarketCellContext" /> <agents path="bin" filter="contexts.NeighbourhoodContext"/> <agents path="../../../bin" filter="contexts.AreaContext"/> </classpath> </model>
-interactive -params "${workspace_loc:KUBUS_PopDyn}/batch/batch_params_set01.xml" "${workspace_loc:KUBUS_PopDyn}/kubus_sh06.rs"
"${workspace_loc:KUBUS_PopDyn}/kubus_sh06.rs"
Be aware that (agent) object may be present in a context hierarchy on more than one level. This is especially true when agents are organised in market cell context, PLZ contexts and/or milieu contexts. Consequently, one and the same object may appear several times when calling:
rootContext.getAgentLayer(Agent.class)
Therefore, in order to obtain unique collections of agents, use the following statement:
for (Agent agent : this.getAgentLayer(Agent.class)) { if (!agents.contains(agent)) { agents.add(agent); } }