Link Search Menu Expand Document

Scenario Templates

Table of contents
  1. Scenario Template Data
  2. Templates Description
  3. Configuration

Users may benefit from starting with an existing scenario, instead of starting with an empty scenario. Using an existing scenario provides users with a faster way to learn about the features of Tramola and to test out certain ideas they have. Scenario Templates are publicly available scenarios that users can use in Tramola, instead of creating their own scenario from scratch.

Scenario Template Data

Scenario Templates consist of one or more scenarios plus a json-file describing the scenarios. All the template data must be hosted on a webserver, as all the files will be referred to by http(s) URLs. The json-file with the templates description must be named scenarios.json.

The following directory structure shows how the data should be stored to be used as scenario templates in Tramola:

my-templates/
├── scenarios.json
├── berlin/
│   ├── berlin.png
│   ├── berlin-v5.5-1pct.config.xml
│   ├── berlin-v5.5-1pct.plans.xml.gz
│   ├── berlin-v5.5-network.xml.gz
│   ├── berlin-v5.5-transit-schedule.xml.gz
│   └── berlin-v5.5-transit-vehicles.xml.gz
├── zurich/
│   ├── config.xml
│   ├── network.xml.gz
│   ├── ...

Templates Description

The templates description ia a JSON-array, containing one object for each scenario. The scenario object contains the following keys:

Key Type Description
name required The name of the scenario.
description required A short description of the scenario.
scenarioURL optional A URL pointing to a website where more details about the scenario can be found.
files required An array of strings, describing what files are part of the scenario. The file names should contain the path to the file, or can be absolute URLs (starting with http(s)://).
imageURL optional File name of an image to be shown to the user.
crs required The epsg-code describing the coordinate reference system to e used for this scenario.

The following listing shows an example of such a templates description in JSON format:

scenarios.json

[
	{
		"name": "The MATSim Open Berlin Scenario",
		"description": "This provides an open MATSim transport model for Berlin, provided by the Transport Systems Planning and Transport Telematics group of Technische Universität Berlin. Please reference/cite the scenario as specified on the scenario webpage.",
		"scenarioURL": "https://github.com/matsim-scenarios/matsim-berlin",
		"files": [
			"berlin/berlin-v5.5-1pct.config.xml",
			"berlin/berlin-v5.5-1pct.plans.xml.gz",
			"berlin/berlin-v5.5-network.xml.gz",
			"berlin/berlin-v5.5-transit-schedule.xml.gz",
			"berlin/berlin-v5.5-transit-vehicles.xml.gz"
		],
		"imageURL": "open-berlin/berlin.png",
		"crs": "EPSG:31468"
	},
	{
		"name": "Zurich",
		"description": "A simple scenario that looks like Zurich but with completely random made-up demand.",
		"files": [
			"zurich/config.xml",
			"zurich/network.xml.gz",
			"zurich/plans.xml.gz",
			"zurich/transitSchedule.xml.gz",
			"zurich/transitVehicles.xml.gz"
		],
		"imageURL": "zurich/zurich.png",
		"crs": "EPSG:2056"
	}
]

Configuration

To make Tramola use your own scenario templates, add the following line to tramola.conf:

tramola.scenarios.templatesURLs += "https://www.my-server.tld/path/to/my-scenarios/"

Then, restart Tramola.

Tramola will then try to access the description file scenarios.json at the specified location and will make the found scenarios available to the users.

If you want to exclude the templates provided by default, add the following line to tramola.conf right before your own templates URL:

tramola.scenarios.templatesURLs = []