Perform the same tasks as request_vehicle. But, the AbstractMobilityService class keep a buffer of User who made a request. Every N time steps the matching is launched on the buffer of User to allow matching optimisation.
Return a new Queue[VehicleActivity] with the new_activities in it. Optimize the order of Queue[VehicleActivity] following criteria such as distance.
Supervisor
Must keep in memory all the paths computed for a User, if the response time for a User is superior to the latest_response_dt then it set another path for this User
Development Plan
User
Two more timestep is added to the class
User
:latest_response_dt
: The maximum response time for a mobility servicelatest_pickup_dt
: The maximum pick up time for a VehicleThis implies that those two parameters must be specified in the
DemandManager
or at least have default valuesVehicle
Vehicle
class has a newState
attribute:Stop
: Vehicle does not moveRepositioning
: Vehicle has no passengers and is moving (Go to a Deposit for instance)PickUp
: Going to User postion for pick upDriving
: Goin got User destinationIt describe the current state of the Vehicle, it can be used by MobilityService classes and modify by MFD Flow and MobilityService.
Vehicle class has a new
Queue[VehicleActivity]
attribute with the followingVehicleActivity
:PickUp
: Set the VehicleState
toPickUp
DropOff
: Set the VehicleState
toDriving
Repositioning
: Set the VehicleState
toRepositioning
The first
VehicleActivity
in theQueue
set the next state of theVehicle
.The
Vehicle
must also track the state of the passengers to know the detours.Mobility Service
Three new methods is added the
AbstractMobilityService
class:Rebalancing
: is executed every N time stepsMatching
: is the currentrequest_vehicle
Replanning
: modify the order of theQueue[VehicleActivity]
of aVehicle
Rebalancing
Signature:
matching(self, stop_veh: List[Vehicle])
Perform operation on
Vehicle
in theState
Stop. (Repositioning, deleting theVehicle
or random journey)Matching
Signature:
matching(self, user_buffer: List[User])
Perform the same tasks as
request_vehicle
. But, theAbstractMobilityService
class keep a buffer ofUser
who made a request. Every N time steps thematching
is launched on the buffer ofUser
to allow matching optimisation.Replanning
Signature:
replanning(self, veh: Vehicle, new_activities: Optional[Set[VehicleActivity]] = None)
Return a new
Queue[VehicleActivity]
with thenew_activities
in it. Optimize the order ofQueue[VehicleActivity]
following criteria such as distance.Supervisor
Must keep in memory all the paths computed for a
User
, if the response time for aUser
is superior to thelatest_response_dt
then it set another path for thisUser