In the following you will find a step-by-step instruction how to use the RSSched programs.
To keep your home clean create a project directory rssched.
mkdir rssched
cd rsschedFirst, we start the solver-server.
-
clone the
rssched-solverrepository into thersscheddirectory:git clone git@github.com:rolling-stock-scheduling/rssched-solver.git cd rssched-solver -
install the docker engine: https://docs.docker.com/engine/install/
-
building the docker image (from the
rssched-solver-directory):docker build --tag eth_scheduling_image . -
loading the image and running the server for the first time (removes old container of the same name):
docker run --rm --env RAYON_NUM_THREADS=16 --publish 3000:3000 --name eth_scheduling_server eth_scheduling_image
Here, the server can use 16 threads and answers on port 3000.
Next, we generate a solver-request from a MATSim run output and send it to the solver-server.
-
Open a new terminal, navigate to
rsschedand clone therssched-matsim-clientand therssched-solverrepository:cd ~/rssched git clone git@github.com:rolling-stock-scheduling/rssched-matsim-client.git cd rssched-matsim-client
-
Put your MATSim run output files, including
-
*.output_config.xml -
*.output_events.xml.gz -
*.output_network.xml.gz -
*.output_transitSchedule.xml.gz -
*.output_transitVehicles.xml.gztogether with the config file containing the solver parameters
-
*.rssched_request_config.xlsx
into the directory that is specified next to the
matsimInputDirectoryfield on the first page of*.rssched_request_config.xlsx.As an example you can use the Kelheim instance that is located in
integration-test/input/de/kelheim/kelheim-v3.0/25pct/.Since the
kelheim-v3.0-25pct.output_events.xml.gzis too large for git use the following command to download them from the official repository or use this link for a manual download.wget https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/kelheim/kelheim-v3.0/output/25pct/kelheim-v3.0-25pct.output_events.xml.gz mv kelheim-v3.0-25pct.output_events.xml.gz integration-test/input/de/kelheim/kelheim-v3.0/25pct/
-
-
Build and run the
rssched-matsim-clientviamvn(you can use the maven-wrapper.mvnwif maven is not installed) to generate a solver-request and send it to the solver-server:./mvnw clean install -DskipTests -DskipITs ./mvnw exec:java -Dexec.args="integration-test/input/de/kelheim/kelheim-v3.0/25pct/kelheim-v3.0-25pct.rssched_request_config.xlsx"As soon as the request is sent to the server you can observe the output of the solver within the server terminal.
The final output (the rolling stock schedule) can be found at
integration-test/output/de/kelheim/kelheim-v3.0/25pct/rssched_kelheim-v3.0-25pct/it_config/it_config.kelheim-v3.0-25pct.scheduler_response.jsonor what ever path is specified next to theoutputDirectoryon the first page of*.rssched_request_config.xlsx.For convenience, lets copy the schedule file to the
rsscheddirectory:cp integration-test/output/de/kelheim/kelheim-v3.0/25pct/rssched_kelheim-v3.0-25pct/it_config/it_config.kelheim-v3.0-25pct.scheduler_response.json ../schedule.json
Finally, we visualize the schedule for analysis.
-
Clone the
rssched-analysisrepository:cd ~/rssched git clone git@github.com:rolling-stock-scheduling/rssched-analysis.git cd rssched-analysis
-
Install poetry a package manager for python: https://python-poetry.org/docs/
-
Install the dependencies for this project via:
poetry install
-
Create the plots (which will open automatically in a browser):
poetry run rssched-plot ../schedule.json
To stop the Docker-container running the solver-server use:
docker stop eth_scheduling_serverThis may take a couple of seconds.
For removing the RSSched programs simple remove the rssched directory with
cd ~
rm -rf rssched