Using event based script files
You can define scripts in a network file. Using the scripts, you manage script files and define the times at which you want to run the script files during the simulation. This allows you to simulate systems that respond to different simulation states and/or influence the simulation. Event-based scripts cannot start or stop the simulation.
Use cases for event-based script files
- You are modeling a traffic management system that depending on a certain amount of traffic, at the beginning of a time step, uses a script file to change the volumes for partial vehicle routes and to allow the use of emergency lanes.
- Opening and closing barriers
- Changing the display state of variable message signs
- Changing the color of vehicles once they have reached their destination parking lot
Impact on network files
When script files change attributes and you then save the network file, the latter will also contain the changed data.
Impact on animations
- When script files change attributes during a simulation and animation recording, these changes also become effective when the animation is replayed.
- When you replay animations, the script files are not called again.
Impact on evaluations
- Script files allow you to access evaluations, e.g. in order to activate evaluations before initialization.
- If the script files change attributes that are used in evaluations, the changed values are saved to the results of the evaluations.