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 rssched
First, we start the solver-server.
-
clone the
rssched-solver
repository into therssched
directory: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
rssched
and clone therssched-matsim-client
and therssched-solver
repository: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.gz
together with the config file containing the solver parameters
-
*.rssched_request_config.xlsx
into the directory that is specified next to the
matsimInputDirectory
field 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.gz
is 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-client
viamvn
(you can use the maven-wrapper.mvnw
if 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.json
or what ever path is specified next to theoutputDirectory
on the first page of*.rssched_request_config.xlsx
.For convenience, lets copy the schedule file to the
rssched
directory: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-analysis
repository: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_server
This may take a couple of seconds.
For removing the RSSched programs simple remove the rssched
directory with
cd ~
rm -rf rssched