Usage

Running

Run Sonomode in eclipse

See Installation on how to set up eclipse for the model. Then, choose a Sonomode X run configuration in order to start the model.

Command line invocation

See invocations.sh for examples of model invocations.

NOTE: The configuration with 8000 agents might take hours to initialise (the network generation takes long) depending on your system. Therefore, consider starting with fewer agents.

Defining parameters ParameterDefinition

Parameters are defined in several ways. Defaults are set in de.cesr.sonomode.param.XPa.java classes. The API documentation of these classes also contain descriptions of the defined parameters. Several parameter configurations are read from an MySQL database (see Installation in order to fill your database with parameters settings from the delivered SQL files). Additionally, any parameter can be set/overwritten by defining it via an XML file (see the ParMa-Framework.

Pre-defined parameters

param ID start paramID end Description
142000 142099 SW – varied: p_rewire, 10 random seeds
142100 142199 HDD - varied: alpha, 10 random seeds, MAX_SEARCH_RADIUS: 1000m
142400 142499 ID - varied: alpha, 10 random seeds, MAX_SEARCH_RADIUS: 1000m
142600 142699 HDD – varied: p_rewire, 10 random seeds
142700 142799 ID – varied: p_rewire, 10 random seeds
143100 143199 HDD - varied: alpha, 10 random seeds, MAX_SEARCH_RADIUS: 2000m
143200 143299 ID - varied: alpha, 10 random seeds, MAX_SEARCH_RADIUS: 2000m
143300 143369 HDD – varied: number of rings, 10 random seeds
143400 143469 ID – varied: number of rings, 10 random seeds

Using DB as parameter definition

  1. Define Milieu preferences
  2. Define Milieu Network preferences (incl. links)
  3. Define Social Network preferences
  4. Define Agents' Geographical Position: Since the spatial network generators rely on geographical positions of agents these positions need to be defined in table sonomode_param_agents. Make sure that number and distributions of agents is compliant with parameters (e.g. propensity of extremists).
  5. Define Main parameters (referencing the previous parameter tables)

    The database settings need to be specified in ./config/DB/DatabaseSettings.xml.

    To add a high number of parameter settings to the database you may use the R-scripts in ./config/R/replication/parameter_creation.

Configuring the Logging Framework

Sonomode applies the Apache Log4J-Framework. To use it, copy ./config/log4j/log4j.properties to a place of your choice, adapt it to your needs and make it available in the classpath. See Apache Log4J for more information.

Doing Batch Runs

  1. Adapt ./config/batch/batch_params.xml to your needs (setting ParamID and runID [optional but recommended])
  2. Chose an .rs folder that contains the desired Repast Symphony configuration (especially with respect to DB outputters) or create your own one based on an existing one (see SesamGIM documentation.
  3. Create an eclipse run configuration (copy an exiting RS run configuration and adapt the .rs folder parameter

Output data

Sonomode provides several ways to output various simulation data.

Adding RS Database Outputter

See Installation for enabling Database output in Repast Simphony.

There are a number of DB output configurations stored in X.rs folders under ./config/rs:

Table of .rs folders
Sonomode_Agent Every Tick: sonomode_result_agents, sonomode_result_social
Sonomode_AgentEnd End Tick: sonomode_result_agents, sonomode_result_social
Sonomode_SocialEnd Every Tick: sonomode_result_social, XY-plot (Opinion)
Sonomode_NoDB XY-plot (Opinion)

Furthermore, you need to edit database settings in the files repast.simphony.data.db.outputter.engine.DbOutputterDescriptorAction_X.xml within the .rs folder that defines the output configuration you want to use:

<!-- Add your MySQL settings here: -->
<url>jdbc:mysql://YourMySqlServer:3306/YourMySqlDatabaseName</url>
<userName>YourMySqlUsername</userName>
<password>YourMySqlPassword</password>
Defining your custom DB outputter

Please, refer to SesamGIM "General Tips and Tricks".

Output .graphml network files

In order to output the social network as .graphml file set the following parameter. The value for OUTPUT_NETWORK determines the tick when the output is triggered. Negative values are interpreted as intervals. Actually, you only need to remove the comments in ./config/param/Parameters.xml at the lines with the desired parameter.

<de.cesr.sonomode.param.SocNetPa:OUTPUT_NETWORK>1</de.cesr.sonomode.param.SocNetPa:OUTPUT_NETWORK>
<de.cesr.sonomode.param.SocNetPa:NETWORK_OUTPUT_FOLDER>./output/networks</de.cesr.sonomode.param.SocNetPa:NETWORK_OUTPUT_FOLDER>

Ouput shapefiles of the root geography

Shapefiles can be created by setting the following parameters. Actually, you only need to remove the comments in ./config/param/Parameters.xml at the lines with the desired parameter.

<de.cesr.sonomode.param.BasicPa:WRITE_SHAPEFILES>10</de.cesr.sonomode.param.BasicPa:WRITE_SHAPEFILES>
<de.cesr.sonomode.param.BasicPa:SHAPEFILE_OUTPUT_FOLDER>10</de.cesr.sonomode.param.BasicPa:SHAPEFILE_OUTPUT_FOLDER>