You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current Python version of the FleetState, the VehicleStates are stored in a dictionary/map.
However, if I see it correctly, there are no vehicles removed during a simulation run. Thus, instead of putting the VehicleStates into a map that requires a search for the correct index each time a VehicleState is accessed, one could also store them into a vector, using the index of the vehicle as its vehicle_id (thus, all vehicle_ids would be in [0,numVehicles-1] )
In this case, the access of a random VehicleState would be (in C++) a trivial operation, as the program immediately knows where to find the vehicle_id-th entry of a vector.
If later vehicles should be "mutable", i.e. put out of service e.g. for maintenance work, one could add a flag inService to VehicleState to tell the dispatcher, whether this vehicle is available or not.
Or is there another reason to use a dictionary/map here?
The text was updated successfully, but these errors were encountered:
In the current Python version of the
FleetState
, theVehicleState
s are stored in a dictionary/map.However, if I see it correctly, there are no vehicles removed during a simulation run. Thus, instead of putting the
VehicleState
s into a map that requires a search for the correct index each time aVehicleState
is accessed, one could also store them into a vector, using the index of the vehicle as itsvehicle_id
(thus, allvehicle_id
s would be in [0,numVehicles-1] )In this case, the access of a random
VehicleState
would be (in C++) a trivial operation, as the program immediately knows where to find thevehicle_id
-th entry of a vector.If later vehicles should be "mutable", i.e. put out of service e.g. for maintenance work, one could add a flag
inService
toVehicleState
to tell the dispatcher, whether this vehicle is available or not.Or is there another reason to use a dictionary/map here?
The text was updated successfully, but these errors were encountered: