Module Contents



This class describes a public transport vehicle that follows

class starling_sim.basemodel.agent.vehicles.public_transport_vehicle.PublicTransportVehicle(simulation_model, agent_id, origin, seats, **kwargs)

Bases: starling_sim.basemodel.agent.vehicles.service_vehicle.ServiceVehicle

This class describes a public transport vehicle that follows a time table often described with a GTFS.


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.


Execute and follow the current trip.

It is assumed that the tripId, routeId, directionId and planning attributes are already set.

public_transport_move_(operator, move_duration, from_stop, to_stop)

Move from one stop to another following the provided line shape if possible.

If no line shape is available, execute a normal move or fly, depending on the operator parameters.

  • operator

  • move_duration

  • from_stop

  • to_stop



Determine if the stop should be processed by the service vehicle.

For public transport, all users waiting at the current stop point are evaluated, so only those going with the right route, direction and destination stop should be picked up. For the dropoff, only the ones in the vehicle are processed.


user_stop – UserStop object


boolean indicating if the stop should be processed


Execute the procedure for stops that cannot be picked up because of capacity.

This method is called when a GET request cannot be served because of the capacity constraint.

For instance, trigger the stop pickup event, or let the agent wait for another vehicle.


user_stop – UserStop object