Last updated on 16th July 2024
You can start using the Simudyne SDK without defining any configuration, since sensible default values are provided. Later on you might need to amend the settings to change the default behavior. Typical examples of settings that you might amend:
The Simudyne SDK reads the config from a simudyneSDK.properties
file in the root directory of a project. If this file cannot be found, default values are set for all config. See an example or if you wish to understand a property consult the reference
All config properties can also be overwritten dynamically in the model code. Use ModelContext.get(this).getConfig()
to get the config for a specific Model, and setString()
, setBoolean()
, setLong()
or setInt()
to set config of a specific type.
ModelConfig.java
public class Housing implements Model {
@Constant public boolean distributed = false;
public void setup(){
if (distributed) {
ModelContext.get(this).getConfig().setString(
"core-abm.backend-implementation",
"simudyne.core.graph.spark.SparkGraphBackend");
}
}
}
A custom simudyneSDK.properties
might look like this
AgentSystem
is marked as @Variable
, should the agents be reported Read More.AgentSystem
is marked as @Variable
, should the accumulators be reported Read More.simudyneSDK.properties
### SimudyneSDK Configuration file
### NEXUS-SERVER ###
nexus-server.port = 8080
nexus-server.hostname = 127.0.0.1
### CORE ###
# core.prng-seed = 1640702558671097951
### CORE-ABM ###
core-abm.max-messaging-phases = 50
# For serialization-level, choose between : {NONE,CHECKED}
core-abm.serialization-level=NONE
core-abm.serialize.agents=true
core-abm.serialize.links=true
core-abm.serialize.accumulators=true
core-abm.local-parallelism=8
For a full example see simudyneSDK.properties