The scenario of the simulation is defined in a simple XML file. The default is
scene.xml, placed in the same directory as the executable. However, it can also be specified on the command line:
There must be a top-level tag in each XML document. In the predefined scenario file
scene.xml and in the examples, it is
<scenario>. At this moment, it does not matter what you write in there - as long as you have exacly one top-level tag.
The first item you should define are the waypoints, because they are used later in the agent definitions.
A waypoint has coordinates
y, and a raduis
r. A waypoint definition also contains the waypoint
id, which is used to reference it later:
<waypoint id="w1" x="-160" y="-51" r=" 17" />
Agent definitions are a bit more complex. An agent has a start position with coordinates
Since it would not be comfortable to define each of potentially many agents individually, there is a way to specify groups of agents. In the agent definition, a agent multiplier
n can be added. N copies of that agent will be spawned into the simulation. It would not be wise to place them all at the same location, so there is a way to spread them out a bit by specifying the
dy modifiers. The agents will be placed evenly distributed between x-dx and x+dx (resp y and dy).
Each agent has waypoints assigned. It will walk from the initial position to the first waypoint, then to the second and so on. The waypoints are added inside the
<agent></agent> tag. Each added waypoint is a reference to a waypoint defined earlier. Please make sure that only waypoints really specified earlier are referenced.
<agent x="60" y="0" n="100" dx="70" dy="10"> <addwaypoint id="w1"/> <addwaypoint id="w2"/> </agent>
Defining obstacles is very simple. Each obstacle is a line from coordinates
x1/y1 to coordinates
x2/y2. It is not relevant where they are added, or how they are grouped.
<obstacle x1="-2" y1="-50" x2="2" y2="-50" />
A box of four walls is defined, a waypoint on each side. 200 agents walk from one side of the box to the other.
This is a screenshot of the DemoApp displaying this example scenario:
(c) Christian Gloor [ c|h|g|l|o|o|r|@|s|i|l|m|a|r|i|l|.|o|r|g| ]