Skip to content

Commit 6e28a68

Browse files
committed
[src/all] Remove option to not refuse rentals
1 parent e12f8ec commit 6e28a68

File tree

4 files changed

+5
-43
lines changed

4 files changed

+5
-43
lines changed

src/evsim/controller/controller.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@
99

1010
class Controller:
1111
def __init__(
12-
self,
13-
cfg,
14-
strategy,
15-
accuracy=(100, 100),
16-
risk=(0, 0),
17-
imbalance_costs=1000,
18-
refuse_rentals=True,
12+
self, cfg, strategy, accuracy=(100, 100), risk=(0, 0), imbalance_costs=1000
1913
):
2014
self.logger = logging.getLogger(__name__)
2115

@@ -42,9 +36,6 @@ def __init__(
4236
self.env = None
4337
self.vpp = None
4438

45-
# Strategy specific optionals
46-
self.refuse_rentals = refuse_rentals
47-
4839
def log(self, message, level=None):
4940
if level is None:
5041
level = self.logger.info

src/evsim/entities/ev.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,7 @@ def charge_timestep(self):
6262
self.debug("Remove from VPP. Too full!")
6363
self.vpp.remove(self)
6464

65-
def drive(
66-
self,
67-
rental,
68-
duration,
69-
trip_charge,
70-
end_charger,
71-
trip_price,
72-
account,
73-
refuse=True,
74-
):
65+
def drive(self, rental, duration, trip_charge, end_charger, trip_price, account):
7566
self.log("Starting trip %d." % rental)
7667

7768
# 1. Check if enough battery for trip left
@@ -87,11 +78,7 @@ def drive(
8778

8879
# TODO: Check overcommitments with perfect benchmark strategy
8980
# 2. Refuse rental if other EVs in VPP can not substitute capacity
90-
if (
91-
refuse
92-
and self.vpp.contains(self)
93-
and self.vpp.commited_capacity > self.vpp.capacity()
94-
):
81+
if self.vpp.contains(self) and self.vpp.commited_capacity > self.vpp.capacity():
9582
self.log(
9683
(
9784
"Refusing rental! "

src/evsim/evsim.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,15 @@ def cli(ctx, debug, name, logs):
9797
default=(0.0, 0.0),
9898
show_default=True,
9999
)
100-
@click.option(
101-
"--refuse-rentals/--no-refuse-rentals",
102-
default=True,
103-
help="Refuses rentals of EV that are commited to VPP.",
104-
)
105100
def simulate(
106-
ctx,
107-
ev_capacity,
108-
charging_speed,
109-
charging_strategy,
110-
industry_tariff,
111-
refuse_rentals,
112-
accuracy,
113-
risk,
101+
ctx, ev_capacity, charging_speed, charging_strategy, industry_tariff, accuracy, risk
114102
):
115103
click.echo("--- Simulation Settings: ---")
116104
click.echo("Debug is %s." % (ctx.obj["DEBUG"] and "on" or "off"))
117105
click.echo("Writing Logs to file is %s." % (ctx.obj["LOGS"] and "on" or "off"))
118106
click.echo("EV battery capacity is set to %skWh." % ev_capacity)
119107
click.echo("Charging speed is set to %skW." % charging_speed)
120108
click.echo("Industry electricity tariff is set to %sEUR/MWh." % industry_tariff)
121-
click.echo("Refusing rentals is set to %s." % (refuse_rentals and "on" or "off"))
122109
click.echo("Charging strategy is set to %s" % charging_strategy)
123110
click.echo("Prediction accuracy is set to (%d%%, %d%%)." % accuracy)
124111
click.echo("Bidding risk is set to (%.2f, %.2f)." % risk)
@@ -136,9 +123,7 @@ def simulate(
136123
ctx.obj["NAME"], charging_speed, ev_capacity, industry_tariff
137124
)
138125

139-
controller = Controller(
140-
cfg, s, accuracy=accuracy, risk=risk, refuse_rentals=refuse_rentals
141-
)
126+
controller = Controller(cfg, s, accuracy=accuracy, risk=risk)
142127
sim = Simulation(cfg, controller)
143128

144129
click.echo("--- Starting Simulation: ---")

src/evsim/simulation/simulation.py

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def lifecycle(self):
127127
trip.end_charging,
128128
trip.trip_price,
129129
account=self.controller.account,
130-
refuse=self.controller.refuse_rentals,
131130
)
132131
)
133132

0 commit comments

Comments
 (0)