A Docker base image for the SUMO traffic simulation package. SUMO (Simulation of Urban MObility) is an open source, highly portable, microscopic and continuous road traffic simulation package designed to handle large road networks.
This uses an automated build on Dockerhub: https://hub.docker.com/r/farberg/sumo-docker/ so you don't have to build the image for yourself.
This Dockerfile uses Docker's concept of volumes where you make one or more folders on your host computer available inside the docker container. The paths of these volumes are specificed in the Dockerfile. In this case, you can make a folder on your host computer available as /data
in the Docker container.
For example, if you have your SUMO files stored in the folder /some/local/path/to/your/data
on your host computer, you can "mount" this folder as follows: -v /some/local/path/to/your/data:/data
. When passing command line arguments to SUMO, use /data
instead of the real folder's name on your computer.
This command illustrates this:
docker run --rm -t -i -p 1234:1234 -v /some/local/path/to/your/data:/data farberg/sumo-docker
Use the following command if you want to control SUMO using the Traffic Control Interface . This exposes SUMO's features on port 1234 via TCP/IP:
docker run -t -i --rm -p 1234:1234 \
-v /some/local/path/to/your/data:/data \
farberg/sumo-docker \
-c /data/cologne.sumocfg \
--remote-port 1234 \
-v
(remove all \ in the previous example if you use a single line instead of multiple lines)
A Java API for TraCI is available here.
An example application that uses TraCI4J is available here.