Skip to content

Commit

Permalink
Change attribute name from allow_opp_charging to allow_oppb_charging
Browse files Browse the repository at this point in the history
Rewrite comment
  • Loading branch information
PaulScheerRLI committed Sep 24, 2024
1 parent 81241cd commit d360777
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion simba/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, id, vehicle_type, schedule) -> None:
self.trips = []
self.schedule = schedule

self.allow_opp_charging: bool = True
self.allow_oppb_charging: bool = True
self.vehicle_type = vehicle_type
self.vehicle_id = None
self.charging_type = None
Expand Down
4 changes: 2 additions & 2 deletions simba/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,9 @@ def generate_scenario(self, args):
station_type = station["type"]
if (station_type == 'opps' and
(trip.rotation.charging_type == 'depb' or
not trip.rotation.allow_opp_charging)):
not trip.rotation.allow_oppb_charging)):
# a depot bus cannot charge at an opp station.
# a bus can only charge at opps if its allowed
# a bus cannot charge at opps if it's not allowed
station_type = None
else:
# get desired soc by station type and trip
Expand Down
6 changes: 3 additions & 3 deletions tests/test_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_opp_charging is True
assert oppb_rotation.allow_oppb_charging 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]
Expand All @@ -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_opp_charging works"
"Rotation has no charge events to check if allow_oppb_charging works"
for rot in oppb_rotations:
rot.allow_opp_charging = False
rot.allow_oppb_charging = False
scen2 = sched.run(args)

index = list(scen2.components.vehicles.keys()).index(vehicle)
Expand Down

0 comments on commit d360777

Please sign in to comment.