TrafficMAS, the code
In general: see the SUMO wiki about installing SUMO
apt-get install sumo
but note that these versions are often very out of date. A good alternative would be to compile from source.
brew install xerces-c gdal proj fox
export CXXFLAGS="-I/opt/X11/include"
export LDFLAGS="-framework OpenGL -framework GLUT -L/usr/X11/lib -L/usr/X11R6/lib -lpython2.7"
./configure --with-python
in the folder where you downloaded the source.make
to compile and make install
to set paths to the binairies.You can test if sumo was installed succesfully by opening a terminal and typing
sumo
It should then return something like
SUMO Version 0.22.0
Copyright (C) 2001-2014 DLR and contributors; http://sumo.dlr.de
License GPLv3+: GNU GPL Version 3 or later <http://gnu.org/licenses/gpl.html>
Use --help to get the list of options.`
If it doesn't work, you should add the sumo executable to your path variable. Alternatively, you can give the link to the sumo executable as a parameter to the TrafficMAS program.
The easiest way is to use Eclipse:
If you also want to run our tests, do the following
If you are using Eclipse, you can easily run the code.
At least four arguments needed
./sim/ hello.mas.xml sumo hello.sumocfg 1337
states that the main directory is ./sim
, that the TrafficMAS config file is hello.mas.xml
, the path for sumo is sumo
(because it was added to the path variable. If not, we would have written something like /usr/bin/sumo
or C:\sumo\sumo.exe
), that the sumo config file is hello.sumocfg
and that the seed the program will use is 1337
. If you want to also see a graphical interface for sumo, replace sumo
with sumo-gui
. In addition to the standard SUMO stuff (roads, edges etc), you can also change the agent profile distributions. Their xml location is specified in MAS.xml. In this xml, spawn-probability
denotes the probability that an agent spawns per tick. For every agent role (or profile), the dist
parameter denotes the relative spawn probability for this role. That is, if dist=0.3
for the Normal role, then if an agent spawns, it will be of the Normal profile 30% of the time.