starling_sim.basemodel.agent.vehicles.public_transport_vehicle

Module Contents

Classes

PublicTransportVehicle

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.

SCHEMA
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.

execute_trip_()

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.

Parameters:
  • operator

  • move_duration

  • from_stop

  • to_stop

Returns:

serve_stop(user_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.

Parameters:

user_stop – UserStop object

Returns:

boolean indicating if the stop should be processed

exceeds_capacity(user_stop)

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.

Parameters:

user_stop – UserStop object