Time Signal At Red
The Time Signal At Red plugin contains a snippet to calculate the Time Signal At Red of deterministic simulations executed by the script.
Time Signal At Red
It is the route occupation time, or the time passed from the moment the head of the train passed the route entry signal till the moment the tail of the train passed the end of the overlap or the route exit signal.
Quick start
- Install or enable the Time Signal At Red plugin.
- Include the
lib/TimeSignalAtRedsnippet in the script. - Execute the simulation.
How it works
deterministic simulation
In a matrix simulation, include the Time Signal At Red:
runSimulations {
withMicro('Micro')
withRollingStock('RollingStock')
// ...
snippet('lib/TimeSignalAtRed')
}
If the script calls a snippet, the Time Signal At Red can itself be included in the default slot_ of the snippet:
snippet('...') {
snippet('lib/TimeSignalAtRed')
}
Output format
The output is in CSV format with the following columns:
- simulationScenario:the scenario name; otherwise, the argument
outputParamsallows you to specify other columns compiled with the scenario parameters, instead of the scenario name. To learn more about the available parameters read the documentation of other plugins. - runKey: for the stochastic simulations, it is the identifier of the run; otherwise, the column is empty.
- route: the route name for which the occupation time and running time were calculated.
- train: the number of the train that occupied the route.
- startingSignal: the name of the route entry signal.
- targetSignal: the name of the route exit signal.
- ocp: the name of the station passed by the route.
- entryTime: the time the train entered the route, expressed in seconds from midnight of the first simulation day.
- occupyTime: the duration of the route occupation (Time Signal At Red), or the time passed from the moment the head of the train passed the route entry signal till the moment the tail of the train passed the end of the overlap or the route exit signal.
- runningTime: the route running time, or the time passed from the moment the head of the train passed the route entry signal till the moment the head of the train passed the end of the route exit signal.
- avgSpeed: the average train speed on the route.
- startingSignalAspect: the name of the last route entry signal aspect, as seen by the train in question.
- startingSignalAspectType: the type of the last route entry signal aspect, as seen by the train in question. The possible types are: STOP, APPROACH, ADVANCED_APPROACH, PROCEED. In the UK signaling system, they are Red, Yellow, Double Yellow and Green respectively.
- targetSignalAspect: the name of the last route exit signal aspect, as seen by the train in question.
- targetSignalAspectType: the type of the last route exit signal aspect, as seen by the train in question.
Snippet arguments
- outputParams: allows you to specify additional columns compiled with the scenario's parameters, instead of using
simulationScenario. - fileName: name of the output file. The default one is
timeSignalAtRed.csv. - routeNames: a map with Trenissimo route name as key and TSAR route name as value, to translate route names from Trenissimo to TSAR naming.
Stochastic simulation
The lib/AverageTimeSignalAtRed snippet calculates the average values for entryTime, occupyTime, runningTime and avgSpeed for each train and each route, for all the stochastic simulation runs. The usage is analogous, and the output format is similar to the one seen above.
runSimulations {
withMicro('Micro')
withRollingStock('RollingStock')
// ...
snippet('lib/AverageTimeSignalAtRed')
stochastic(runs: 4)
Output format
The output is in CSV format with the following columns:
- simulationScenario:the scenario name; otherwise, the argument
outputParamsallows you to specify other columns compiled with the scenario parameters, instead of the scenario name. To learn more about the available parameters read the documentation of other plugins. - route: the route name for which the occupation time and running time were calculated.
- train: the number of the train that occupied the route.
- startingSignal: the name of the route entry signal.
- targetSignal: the name of the route exit signal.
- ocp: the name of the station passed by the route.
- minEntryTime: the minimum value of the route entry times, expressed in seconds from midnight of the first simulation day.
- avgEntryTime: the average value of the route entry times, expressed in seconds from midnight of the first simulation day.
- avgOccupyTime: the average occupation time of the route (Time Signal At Red), or the time passed from the moment the head of the train passed the route entry signal till the moment the tail of the train passed the end of the overlap or the route exit signal.
- avgRunningTime: average value of the route running times, or the time passed from the moment the head of the train passed the route entry signal till the moment the head of the train passed the route exit signal
- avgSpeed: the average train speed on the route.
- STOP: the number of iterations where the route entry signal was seen having a STOP aspect.
- APPROACH: the number of iterations where the route entry signal was seen having an APPROACH aspect.
- ADVANCED_APPROACH: the number of iterations where the route entry signal was seen having an ADVANCED_APPROACH aspect.
- ADVANCED_APPROACH: the number of iterations where the route entry signal was seen having a PROCEED aspect.
Snippet arguments
- outputParams: allows you to specify additional columns compiled with the scenario's parameters, instead of using
simulationScenario. - fileName: name of the output file. The default one is
averageTimeSignalAtRed.csv. - routeNames: a map with Trenissimo route name as key and TSAR route name as value, to translate route names from Trenissimo to TSAR naming.
Tutorials
Examples
Usage of Time Signal At Red in combination with Aspect Matrix:
snippet('lib/AspectMatrix',
// snippet configuration
rollingStock: 'RollingStock',
timetable:'Timetable',
micro: 'Micro'
) {
// default slot
snippet('lib/TimeSignalAtRed', outputParams: ['trainNumber', 'routeUnderTest', 'aspectPair'])
}
Usage of Time Signal At Red with a different route naming scheme:
runSimulations {
withMicro('Micro')
withRollingStock('RollingStock')
// ...
snippet('lib/TimeSignalAtRed',
routeNames: [
'SE4681-#LOS GLHM680': 'SE4681-SE4691', // Trenissimo route SE4681-#LOS GLHM680 is exported as SE4681-SE4691
'SE4683-#LOS GLHM680': 'SE4683-SE4691',
]
)
}