starling_sim.basemodel.simulation_model
Module Contents
Classes
Generic simulation model |
- class starling_sim.basemodel.simulation_model.SimulationModel(scenario)
Generic simulation model
It must be extended to describe concrete systems, with their specific topologies and agents
- name = 'Unnamed model'
- agent_type_class
- leaving_codes
- modes
- environment_class
- population_class
- input_class
- output_class
- _base_init(scenario)
- _init_model(scenario)
Initialise the simulation model with element that do not depend on the scenario.
This method is called once, during the model initialisation.
- Parameters:
scenario – SimulationScenario object
- _init_scenario_run(scenario)
Initialise the scenario-related elements of the model.
This method should be called before running a new simulation scenario.
- Parameters:
scenario – SimulationScenario object
- _init_environment(scenario)
Initialise the simulation environment using the environment_class attribute.
- Parameters:
scenario – SimulationScenario object
- _init_agent_population()
Initialise the simulation agent population using the population_class attribute.
- _init_dynamic_input()
Initialise the simulation dynamic input using the input_class attribute.
- _init_output_factory()
Initialise the simulation output factory using the output_class attribute.
- _init_scheduler()
Initialise the simulation scheduler.
- setup()
Sets the entries of the simulation model and prepares it for the simulation run. It is here that the files and data are effectively read and imported in the model.
This method can be extended to manage and setup other elements of the model
- _setup_model()
Set up the simulation model elements that do not depend on the scenario.
This method is called once, during the model setup.
- _setup_scenario_run()
Set up the scenario-related elements of the model.
This method should be called before running a new simulation scenario.
- _setup_environment()
Set up the simulation environment.
- _setup_dynamic_input()
Set up the simulation dynamic input.
- _setup_output_factory()
Set up the simulation output factory.
- run()
Runs the simulation model until the time limit is reached.
This method can be extended to run other elements of the model
- generate_output()
Generate an output of the current simulation
- add_base_leaving_codes()
Add the base leaving codes to the ones specified for the model.
This will overwrite any custom code named as a base code.
- setup_seeds()
Set the seeds of the random functions
- periodic_hour_log()
- setup_gtfs()
Set up a gtfs timetable for the simulation.
- classmethod get_agent_type_schemas()