Replay¶
Start¶
- enter the
frontendfolder and openindex.htmlin your browser. - choose the roadnet log file (as defined by
roadnetLogFilefield in the config file, not ‘roadnetFile’) and wait for it to be loaded. When it has finished loading, there will be a message shown in the info box. - choose the replay file (as defined by
replayLogFilefield in the config file) . - choose the chart data file (optional, see section Chart below).
- press
Startbutton to start the replay.
Control¶
- Use the mouse to navigate. Dragging and mouse wheel zooming are supported.
- Move the slider in Control Box to adjust the replay speed. You can also press
1on keyboard to slow down or2to speed up. - Press
Pausebutton in Control Box to pause/resume. You can also double-click on the map to pause and resume. - Press
[or]on keyboard to take a step backward or forward. - To restart the replay, just press
Startbutton again. - The
debugoption enables displaying the ID of vehicles, roads and intersections during a mouse hover. This will cause a slower replaying, so we suggest using it only for debugging purposes.
Chart¶
The player supports showing the change of different metrics in a chart simultaneously with the replay process.
To provide required data, a log file in a format as shown below is needed:
The first line is the title of the chart.
Each row stands for a time step and each column stands for a specific metric. For example, to track vehicle numbers of three crossroads respectively, we need three columns and each column stands for the vehicle number of a certain crossroads.
In one row, numbers are separated by one or more spaces or tabs.
The numbers in one column will be shown as points connected by one line in the chart.
Note
Make sure that each row is corresponding with the right time step.
Notes¶
- To get the example replay files, run
download_replay.pyunderfrontendfolder. - If you create a new Engine object with same
replayLogFile, it will clear the old replay file first - Using
eng.reset()won’t clear old replays, it will append newly generated replay to the end ofreplayLogFile - You can change
replayLogFileduring runtime usingset_replay_file, see set-replay-file