licit-lab / MnMS

Agent-based Multimodal Urban Moblity Simulator resulting from the ERC MAGnUM project
GNU Lesser General Public License v3.0
9 stars 4 forks source link

Implement Ride Sharing #94

Open floriangc opened 2 years ago

floriangc commented 2 years ago

Development Plan

User

Two more timestep is added to the class User:

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:

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:

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

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