1st Step: Import Projects

In order to use the railway controller and the environment of the railway system two projects must be imported. The projects are located in the git repository 17ss-railway in the folder code/Controller_SCTx and code/Environment. Both need to be imported in KIELER.

2nd Step: Configure Builder

The next step is the building of the project. To do the project settings must be configured adequately.

First go to Controller_SCTxProperties. The properties window will pop up and in the left column there is an entry KIELER Modeling Builder. Click on it and choose assets\BuildConfig.kibuild as the build file.

Repeat this procedure for the Environment project.

3rd Step: Build

Hit ProjectClean... and choose the option 'Clean projects selected below'. Choose the projects Controller_SCTx and Environment, check the 'Start a build immediately' and 'Build only the selected projects'.

Now wait, this might take a while.

4th Step: Initialize Visualization

To make sure no simulation is running hit the stop button. Open the 'Simulization Visualization' perspective and click on the little folder button 'Open KiViz'. Load the file 'EnvironmentVisualization.kiviz' located in Workspace/Environment/visualization. Now the view should show a picture of the railway track layout.

5th Step: Start Simulation

Go to the file 'EnvCont.kisim' for Windows users and 'EnvCont_Linux' for Linux users in the Environment project located in the assets folder. Right-click on it and choose 'Run as...' → 'KIELER Simulation'. In the 'Data Pool' view you can now enter the needed inputs and see the actual outputs. Additionally to this table the view will update and show the state of the railway system.

Firstly you should enter a train_setup. This indicates the track on which the trains are starting and it should be entered before the first tick. It is an array for eleven trains and if not all of them are used, leave the entry blank (0). Now the following inputs are interesting:

destination[NUM_TRAINS]

The next destination for the specific train. This is supposed to be a station track but be aware that if the station track is occupied the train will take an alternative track.

random_mode

When enabled the trains will be given a destination automatically and drive around.

no_forced_destination[NUM_TRAINS]

If a train is in a station and not driving anywhere, it is possible that a different train is blocked. If this variable is set to true for the specific train, this train will not be forced to drive somewhere.

Tags: