diff --git a/simba/rotation.py b/simba/rotation.py index 0ae8e9f..8320625 100644 --- a/simba/rotation.py +++ b/simba/rotation.py @@ -11,7 +11,7 @@ def __init__(self, id, vehicle_type, schedule) -> None: self.trips = [] self.schedule = schedule - self.allow_oppb_charging: bool = True + self.allow_opp_charging_for_oppb: bool = True self.vehicle_type = vehicle_type self.vehicle_id = None self.charging_type = None diff --git a/simba/schedule.py b/simba/schedule.py index cdac35b..25b8312 100644 --- a/simba/schedule.py +++ b/simba/schedule.py @@ -922,7 +922,7 @@ def generate_scenario(self, args): station_type = station["type"] if (station_type == 'opps' and (trip.rotation.charging_type == 'depb' or - not trip.rotation.allow_oppb_charging)): + not trip.rotation.allow_opp_charging_for_oppb)): # a depot bus cannot charge at an opp station. # a bus cannot charge at opps if it's not allowed station_type = None diff --git a/tests/test_schedule.py b/tests/test_schedule.py index ad9cfbb..507926a 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -68,7 +68,7 @@ def test_allow_opp_charging(self): assert len(oppb_rotations) >= 1 oppb_rotation = oppb_rotations[0] vehicle = oppb_rotation.vehicle_id - assert oppb_rotation.allow_oppb_charging is True + assert oppb_rotation.allow_opp_charging_for_oppb is True index = list(scen.components.vehicles.keys()).index(vehicle) min_soc = min(s[index] for s in scen.socs if s[index] is not None) vehicle_event = [e for e in scen.events.vehicle_events if e.vehicle_id == vehicle] @@ -78,9 +78,9 @@ def test_allow_opp_charging(self): charge_events += 1 assert charge_events > 0, \ - "Rotation has no charge events to check if allow_oppb_charging works" + "Rotation has no charge events to check if allow_opp_charging_for_oppb works" for rot in oppb_rotations: - rot.allow_oppb_charging = False + rot.allow_opp_charging_for_oppb = False scen2 = sched.run(args) index = list(scen2.components.vehicles.keys()).index(vehicle)