|Home|Quick Start|Sprints|Requirements|Architecture|Server Config|API|Simulation|Agents|
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
Configuration
The server reads its configuration from JSON files. The first start of the server needs the file to be given in order to start the simulation. If the user is running the same simulation multiple times, it's not needed to give the configuration file every time.
The structure of a configuration file can be seen in the exemple below. The individual parts are explained in the following.
{
"server" : {},
"match" : []
}
server
The server block defines the configuration for the whole simulation. It will maintain without changes during all the simulation
Any request of connection after reached the limit of agents before the start or during the simulation will be ignored
"server" : {
"agentsPerSimulation" : 10,
"launch" : "key",
"port" : 12300,
"agentTimeout" : 4000,
"resultPath" : "results",
"logPath" : "logs",
"replayPath" : "replays"
}
-
agentsPerSimulation : The number of agents that the simulator can connect at the beginning of the simulation
-
lauch : The way the simulation will start every step
-
key
: The server will wait the user enter the key to start -
[Int]s
: The server waits a several seconds to start
-
-
port : The port on which to listen for incoming connections
-
agentTimeOut : The limit timme to an agent send its action to the server
-
resultPath : The directory which will contain all the information about victims, deaths and materials collected
-
logPath : The directory with all the steps and actions done during the simulation
-
replayPath : The simulation state can be saved after every step. Those replay files can be used again with the web monitor
match
This block describes exactly how each simulation will be set up and is mostly scenario dependent. One object in the match array represents one simulation.
"match": [{
"id" : "2018-SampleSimulation",
"scenarioClass" : "city.CitySimulation",
"steps" : 1000,
"map" : "paris",
"minLon" : 2.26,
"maxLon" : 2.41,
"minLat" : 48.82,
"maxLat" : 48.90,
"centerLat" : 48.8424,
"centerLon" : 2.3209,
"cellSize" : 200,
"randomSeed" : 17,
"randomFail" : 1,
"rechargeRate" : 2,
"roles" : {},
"generate" : {}
}]
-
id : Identifier of the simulation
-
scenarioClass : The path of the scenario's main class
-
steps : Number of steps the simulation will last
-
map : The map that will be used in this simulation
-
min/maxLon/Lat : The limits where the simulation will happen
-
centerLon/Lat : An internal value used for positioning things and routing; basically, any location of the map is considered reachable if there exists a route between this "center" and that location in both directions
-
cellSize : The length in meters an agent with speed 1 could travel in a single step
-
randomSeed : The random seed that is used for map generation and action execution
-
randomFail : The probability for any action to fail (in %)
-
rechargeRate : The energy that is restored between 1 and 2 times with 1 recharge action
-
roles : Can be seen in the
Agents
file