Skip to content

Commit

Permalink
Change check for depb / oppb
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulScheerRLI committed Aug 10, 2023
1 parent 90bd707 commit 18e1836
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions simba/station_optimization.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
""" Optimization that tries minimizing the amount of electrified stations to achieve full
electrification.
"""

from copy import deepcopy
import json
import sys
Expand Down Expand Up @@ -122,9 +120,9 @@ def run_optimization(conf, sched=None, scen=None, args=None):
# filter out depot chargers if option is set
if conf.run_only_oppb:
optimizer.config.exclusion_rots = optimizer.config.exclusion_rots.union(
r for r in sched.rotations if "depb" in sched.rotations[r].charging_type)
r for r in sched.rotations if "depb" == sched.rotations[r].charging_type)
sched.rotations = {r: sched.rotations[r] for r in sched.rotations
if "oppb" in sched.rotations[r].charging_type}
if "oppb" == sched.rotations[r].charging_type}
assert len(sched.rotations) > 0, "No rotations left after removing depot chargers"

# rebasing the scenario meaning simulating it again with SpiceEV and the given conditions of
Expand Down

0 comments on commit 18e1836

Please sign in to comment.