Skip to content

masc/sumo-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 

Repository files navigation

SUMO Docker Base Image

Docker Pulls Docker Automated build Docker Build Status

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.

Run with Docker

This uses an automated build on Dockerhub: https://hub.docker.com/r/socialcars/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 socialcars/sumo-docker

Run with CircleCI and Automate Simulation Runs

It is also possible to automate simulation runs by using CircleCI as an execution engine. The results of the simulation can then be published as a GitHub release.

Example

See masc/sumo-stressgrid. To automate a simulation one could use the following workflow:

  1. Setup CircleCI to build your project.
  2. Develop simulation code in the master branch until it is mature enough to be used for a simulation.
  3. Fork a new branch, e.g. sim-4x4 to simulate a 4x4 grid or sim-4x6.
  4. Adapt circle.yaml in that branch to your needs, i.e. add parameters, etc.
  5. Push to repository and let CircleCI run your simulation and publish the results.

Control SUMO via TraCi

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 \
	socialcars/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)

Java API for TraCI

A Java API for TraCI is available here.

An example application that uses TraCI4J is available here.

Credits

Initially based on work done by pfisterer and farberg.

About

A Docker base image for the SUMO traffic simulation package.

Resources

License

Stars

Watchers

Forks

Packages

No packages published