starling_sim.models.SB_VS.user
Module Contents
Classes
This class describes a simple station-based vehicle-sharing user |
- class starling_sim.models.SB_VS.user.User(simulation_model, agent_id, origin, destination, **kwargs)
Bases:
starling_sim.basemodel.agent.persons.person.Person
This class describes a simple station-based vehicle-sharing user
- SCHEMA
- loop_()
Main loop of a station-based vehicle-sharing user
- try_new_request_()
Try to request the best station according to user’s state.
The best station is the closest to agent. According to their has_station_info attribute, users may ignore the stations that can’t offer them the service they look for. If no station is found, they wait 30 seconds and try again.
- Returns:
StationRequest object, completed according to request result
- request_tries(station_request)
Execute a sequence of attempts for the given request.
Each time the waiting time exceeds the agent’s patience, they reevaluate their decision of staying in the queue. This evaluation is done by the quit_decision method. This results in a Request with a sequence of waiting times
- Parameters:
station_request – StationRequest object
- best_station_for()
Return the best station according to the agent’s state.
It corresponds to the closest station to either current position or destination, depending on the agent having a vehicle or not. Some stations may be ignored (e.g. empty stations), depending on the information detained by the agent
- Returns:
Station object, or None if no station is found
- quit_decision(request)
Decide if user should quit after exceeding its request patience
- Parameters:
request – StationRequest object
- Returns:
boolean, True for quitting the request queue