Railway Visualization Overview
The railway visualization is created for the KIELER Simulation Visualization (KiVis). Therefore an SVG file has been created, in which the elements that are animated have a unique Id. The Model Railway Track Layout svg has been choosen for this task, because it shows a more detailed view of the railway, in contrast to the Model Railway Track Scheme.
Another file required for the visualization is a kivis file. It defines how the SVG elements are animated to represent the running simulation. For the railway, this file is rather complex and thus created from Freemarker templates.
The following explains the structure of the Freemarker template files that generate the kivis files.
The KiVis file templates
There are dedicated visualizations for the environment SCChart and controller SCChart. Both reference the same base templates, that provide animations and interactions for common railway elements, e.g., points and contacts. Further the same constant definition file is used by the templates.
This results in the following template files for the visualization:
File | Description | References |
---|---|---|
EnvironmentVisualization.ftl | The top level template for the environment visualization. Has animations for the trains, based on their exact position from the environment (track, branch, pos). | BasicVisualization.ftl |
ControllerVisualization.ftl | The top level template for the controller visualization. Has animations for the trains, based on the track position, that is assumed by the controller. | BasicVisualization.ftl |
BasicVisualization | Has animations and interactions that can be used by both, the environment and controller. Furthermore the power of the tracks is animated and can be changed with a click on the corresponding track. | Constants.ftl Util.ftl |
Constants.ftl | Defines railway constants, mostely taken from the wagon.sctx Furthermore the file contains classification of the tracks, to calculate with these. For instance, there are lists with all tracks, only with tracks that have branches, or which branches belong to which tracks. | |
Util.ftl | Util constants |