Implement Ride Sharing
- Dominant language
- Python
- Stars
- 21
- Forks
- 7
- Avg merge
- 2h 4m
- Merged PRs (30d)
- 2
Description
# Development Plan
## User
Two more timestep is added to the class `User`:
- `latest_response_dt`: The maximum response time for a mobility service
- `latest_pickup_dt`: The maximum pick up time for a Vehicle
This implies that those two parameters must be specified in the `DemandManager` or at least have default values
## Vehicle
`Vehicle` class has a new `State` attribute:
- `Stop`: Vehicle does not move
- `Repositioning`: Vehicle has no passengers and is moving (Go to a Deposit for instance)
- `PickUp`: Going to User postion for pick up
- `Driving`: Goin got User destination
It 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 following `VehicleActivity`:
- `PickUp`: Set the Vehicle `State` to `PickUp`
- `DropOff`: Set the Vehicle `State` to `Driving`
- `Repositioning`: Set the Vehicle `State` to `Repositioning`
The first `VehicleActivity` in the `Queue` set the next state of the `Vehicle`.
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 steps
- `Matching`: is the current `request_vehicle`
- `Replanning`: modify the order of the `Queue[VehicleActivity]` of a `Vehicle`
### Rebalancing
Signature: `matching(self, stop_veh: List[Vehicle])`
Perform operation on `Vehicle` in the `State` Stop. (Repositioning, deleting the `Vehicle` or random journey)
### Matching
Signature: `matching(self, user_buffer: List[User])`
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.
### Replanning
Signature: `replanning(self, veh: Vehicle, new_activities: Optional[Set[VehicleActivity]] = None)`
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`
Contributor guide
Assessment
This issue has not been assessed yet.