starling_sim.basemodel.agent.requests

This module regroups the classes describing the requests made by an agent during the simulation.

Requests are used for the interaction between users and operators.

Stops describe the action of a service vehicle, for instance picking up a user.

Module Contents

Classes

Request

Class describing a request made by an agent.

StationRequest

Class describing a request made to a vehicle station.

TripRequest

Class describing a trip request made to a service operator.

Stop

Class describing a stop in a service vehicle planning

UserStop

Class describing the stop of a user, either a pickup or dropoff.

StopPoint

Class describing a stop point, where several user stops can be grouped.

Operation

Class describing a stop in a service vehicle planning

class starling_sim.basemodel.agent.requests.Request(agent, timestamp, structure=None, position=None, request_type=None, prebooked=None)

Class describing a request made by an agent.

GET_REQUEST = 'GET'
PUT_REQUEST = 'PUT'
TAXI_REQUEST = 'TAXI'
STR_LIST = ['structure', 'position', 'type']
set_request_event(event=None)

Set the event attribute with the given SimPy event.

By default, the a basic Event object is added, which can be triggered using the succeed method.

If the request has no agent, try to get the scheduler from the structure.

Parameters:

event – SimPy Event object

succeed(new_event=None)

Trigger the request event as successful and replace it with the new event.

Parameters:

new_event – SimPy Event object

fail(new_event=None)

Trigger the request event as failed and replace it with the new event.

Parameters:

new_event – SimPy Event object

cancel()

Set success to false and call the structure cancel method.

__str__()

Give string display to the request.

Returns:

string with some of the request information

__repr__()

Return repr(self).

class starling_sim.basemodel.agent.requests.StationRequest(agent, timestamp, station, request_type)

Bases: Request

Class describing a request made to a vehicle station.

class starling_sim.basemodel.agent.requests.TripRequest(agent, timestamp, operator, number, request_id, trip_id=None)

Bases: Request

Class describing a trip request made to a service operator.

STR_LIST = ['structure', 'id', 'position', 'type']
set_stops(pickup_request, dropoff_request)

Set the pickup and dropoff attributes of the request.

Parameters:
  • pickup_request – UserStop object with type “GET”

  • dropoff_request – UserStop object with type “PUT”

set_trip(trip_id)

Set the pickup and dropoff trip id, if they are UserStops.

Parameters:

trip_id

pickup_succeed()
dropoff_succeed()
class starling_sim.basemodel.agent.requests.Stop(position, stop_type)

Class describing a stop in a service vehicle planning

GET_REQUEST = 'GET'
PUT_REQUEST = 'PUT'
TAXI_REQUEST = 'TAXI'
STOP_POINT = 'STOP_POINT'
REPOSITIONING = 'REPOSITIONING'
class starling_sim.basemodel.agent.requests.UserStop(stop_type, position, request_id, requested_time=None, max_time=None, max_travel_time=None, stop_point_id=None, trip_id=None)

Bases: Stop

Class describing the stop of a user, either a pickup or dropoff.

User stops can be used as is in the plannings, or grouped in stop points.

User stops should be grouped by pair (pickup and dropoff) in TripRequest objects, using the setup_stops method.

get_process_time()

Get the time of the effective stop processing.

Pickups are processed at departure time, and dropoffs are processed at arrival time.

Returns:

process time of the stop

set_twin_stop(twin_stop)

Set the user stop twin stop.

Parameters:

twin_stop – UserStop object

is_feasible()

Check if the stop point is feasible, ie if the time constraints are respected.

Returns:

Boolean indicating if the user stop is feasible

__str__()

Give a string display to the user stop.

Returns:

string with some of the user stop information

__repr__()

Return repr(self).

class starling_sim.basemodel.agent.requests.StopPoint(position, stop_id, name='unnamed_stop')

Bases: Stop

Class describing a stop point, where several user stops can be grouped.

Stop points may be serviced by several vehicles following different trips. Servicing a stop point means servicing all the user stops that correspond to the service vehicle trip

__str__()

Give a string display to the stop point.

Returns:

string with some of the stop point information

__repr__()

Return repr(self).

class starling_sim.basemodel.agent.requests.Operation(stop_type, position, total, targets=None, station_id=None)

Bases: Stop

Class describing a stop in a service vehicle planning

__str__()

Give a string display to the operation.

Returns:

string with some of the operation information

__repr__()

Return repr(self).