starling_sim.basemodel.agent.operators.public_transport_operator
Module Contents
Classes
Class describing an operator of a public transport service |
- class starling_sim.basemodel.agent.operators.public_transport_operator.PublicTransportOperator(simulation_model, agent_id, fleet_dict, extend_graph_with_stops=True, **kwargs)
Bases:
starling_sim.basemodel.agent.operators.operator.Operator
Class describing an operator of a public transport service
- SCHEMA
- OPERATION_PARAMETERS_SCHEMA
- ROUTE_TYPE_ICONS
- FLEET_TYPE
- init_service_info()
Import and initialise the data structures containing service information and line shapes.
- _stops_table_from_gtfs()
Create a stops table from the operator’s GTFS (service_info).
- Returns:
stops table
- init_trips()
Initialise the trips attribute using simulation data.
- get_route_and_direction_of_trip(trip_id)
Evaluate the route and direction of a trip using the service info.
- Parameters:
trip_id –
- Returns:
- create_public_transport_fleet()
Create a fleet for the public transport service.
Services vehicles are generated using the block_id field of the gtfs. When no block id is provided for a trip, a vehicle dedicated to this single trip is generated.
- create_service_vehicle(agent_id, trip_id_list)
Create a new service vehicle in the simulation.
- Parameters:
agent_id – id of the new vehicle
trip_id_list – list of trips to be realised by service the vehicle
- build_planning_of_trip(trip_id)
Build the planning corresponding to the trip from the gtfs.
- Parameters:
trip_id – gtfs trip_id
- Returns:
trip planning, list of StopPoint objects
- loop_()
This method represents the life cycle of an agent.
The loop process will be added to the simulation environment after the agent creation. Agents may perform actions that have a duration. They must then yield other processes such as waiting or moving, and will resume at the end of their action.
The loop must be extended to represent a specific behavior, using possibly inherited methods.