calculate the cumulative distance for each of shape_ids
use geopandas to sum the distance of the shapefile
append this distance to each trip as trip_dist
Walk a trip
for a trip passed to walk_route, pull trip.trip_dist, convert to an energy_req, and subtract from bus['energy']
if the destination termini has a nearby_charger than check if the time before the next required departure (trip index + 1 in trips) is less than some threshold. If so, than charge at some given rate self.charge_rate and append that energy value back to bus['energy']. If there is no nearby charger, than return and the loop will continue, attempting to serve the next trip.
walk_route()
)trip_dist
walk_route
, pulltrip.trip_dist
, convert to an energy_req, and subtract from bus['energy']nearby_charger
than check if the time before the next required departure (trip index + 1 intrips
) is less than some threshold. If so, than charge at some given rateself.charge_rate
and append that energy value back to bus['energy']. If there is no nearby charger, than return and the loop will continue, attempting to serve the next trip.