-
Notifications
You must be signed in to change notification settings - Fork 0
Developing
Asbjørn Djupdal edited this page Sep 23, 2022
·
1 revision
The system is divided into the following main parts:
- Global settings (file
settings.py
) - Initial state generation (subdirectory
init_state
) - Ideal state calculation (subdirectory
ideal_state
) - Event simulator (subdirectory
sim
) - Policy (subdirectory
policy
) - Visualization (subdirectory
visualization
) - GUI dashboard (subdirectory
GUI
)
Create a class that inherits the Policy class found in policy/policy.py
. The get_best_action()
method must be reimplemented by your subclass and is responsible for returning the next action for the given service vehicle. The method gets a reference to the simulator object, from which all simulator state can be obtained.
Some useful functions and objects found through the simulator object:
-
simul.day()
: Return current day -
simul.hour()
: Return current hour -
simul.state
: State-object representing the entire city bike state (sim/State.py
) -
simul.state.vehicles
: List of all service vehicles (sim/Vehicle.py
) -
simul.state.stations
: List of all stations (sim/Station.py
) -
simul.state.depots
: List of all depots (sim/Depot.py
) -
simul.state.get_all_scooters()
: List of all bikes and electric scooters (sim/Bike.py
andsim/Scooter.py
) -
simul.state.get_distance()
: Get distance between two stations -
simul.state.get_trip_speed()
: Get average bike speed between two stations
Your simulation object has a member metrics
(sim/Metric.py) where various data about the simulation is collected.