eflips-depot 4.2.2__py3-none-any.whl → 4.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eflips/depot/api/__init__.py +6 -31
- eflips/depot/api/private/util.py +4 -6
- {eflips_depot-4.2.2.dist-info → eflips_depot-4.3.1.dist-info}/METADATA +1 -1
- {eflips_depot-4.2.2.dist-info → eflips_depot-4.3.1.dist-info}/RECORD +6 -6
- {eflips_depot-4.2.2.dist-info → eflips_depot-4.3.1.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.2.2.dist-info → eflips_depot-4.3.1.dist-info}/WHEEL +0 -0
eflips/depot/api/__init__.py
CHANGED
|
@@ -278,7 +278,7 @@ def simple_consumption_simulation(
|
|
|
278
278
|
timeseries = None
|
|
279
279
|
energy_used = consumption * trip.route.distance / 1000 # kWh
|
|
280
280
|
current_soc = soc_start - energy_used / vehicle_type.battery_capacity
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
# Create a driving event
|
|
283
283
|
current_event = Event(
|
|
284
284
|
scenario_id=scenario.id,
|
|
@@ -294,7 +294,6 @@ def simple_consumption_simulation(
|
|
|
294
294
|
timeseries=timeseries,
|
|
295
295
|
)
|
|
296
296
|
session.add(current_event)
|
|
297
|
-
session.flush() # TODO
|
|
298
297
|
|
|
299
298
|
# If the vehicle is
|
|
300
299
|
# - Capable of opportunity charging
|
|
@@ -365,7 +364,7 @@ def simple_consumption_simulation(
|
|
|
365
364
|
soc_end=post_charge_soc,
|
|
366
365
|
event_type=EventType.CHARGING_OPPORTUNITY,
|
|
367
366
|
description=f"Opportunity charging event for trip {trip.id}.",
|
|
368
|
-
timeseries=
|
|
367
|
+
timeseries=timeseries,
|
|
369
368
|
)
|
|
370
369
|
current_soc = post_charge_soc
|
|
371
370
|
session.add(current_event)
|
|
@@ -493,8 +492,6 @@ def apply_even_smart_charging(
|
|
|
493
492
|
|
|
494
493
|
:return: None. The results are added to the database.
|
|
495
494
|
"""
|
|
496
|
-
logger = logging.getLogger(__name__)
|
|
497
|
-
|
|
498
495
|
with create_session(scenario, database_url) as (session, scenario):
|
|
499
496
|
depots = session.query(Depot).filter(Depot.scenario_id == scenario.id).all()
|
|
500
497
|
for depot in depots:
|
|
@@ -523,7 +520,7 @@ def apply_even_smart_charging(
|
|
|
523
520
|
next_event is None
|
|
524
521
|
or next_event.event_type != EventType.STANDBY_DEPARTURE
|
|
525
522
|
):
|
|
526
|
-
|
|
523
|
+
warnings.warn(
|
|
527
524
|
f"Event {charging_event.id} has no STANDBY_DEPARTURE event after a CHARGING_DEPOT "
|
|
528
525
|
f"event. No room for smart charging."
|
|
529
526
|
)
|
|
@@ -1102,8 +1099,6 @@ def _generate_vehicle_events(
|
|
|
1102
1099
|
:return: None. The results are added to the dictionary.
|
|
1103
1100
|
"""
|
|
1104
1101
|
|
|
1105
|
-
logger = logging.getLogger(__name__)
|
|
1106
|
-
|
|
1107
1102
|
# For convenience
|
|
1108
1103
|
area_log = current_vehicle.logger.loggedData["dwd.current_area"]
|
|
1109
1104
|
slot_log = current_vehicle.logger.loggedData["dwd.current_slot"]
|
|
@@ -1123,7 +1118,7 @@ def _generate_vehicle_events(
|
|
|
1123
1118
|
if waiting_info["waiting_time"] == 0:
|
|
1124
1119
|
continue
|
|
1125
1120
|
|
|
1126
|
-
|
|
1121
|
+
warnings.warn(
|
|
1127
1122
|
f"Vehicle {current_vehicle.ID} has been waiting for {waiting_info['waiting_time']} seconds. "
|
|
1128
1123
|
)
|
|
1129
1124
|
|
|
@@ -1193,24 +1188,6 @@ def _generate_vehicle_events(
|
|
|
1193
1188
|
and "end" in dict_of_events[time_stamp].keys()
|
|
1194
1189
|
):
|
|
1195
1190
|
start_this_event = dict_of_events[time_stamp]["end"]
|
|
1196
|
-
if start_this_event in dict_of_events.keys():
|
|
1197
|
-
if (
|
|
1198
|
-
dict_of_events[start_this_event]["type"]
|
|
1199
|
-
== "Trip"
|
|
1200
|
-
):
|
|
1201
|
-
logger.info(
|
|
1202
|
-
f"Vehicle {current_vehicle.ID} must depart immediately after charged. "
|
|
1203
|
-
f"Thus there will be no STANDBY_DEPARTURE event."
|
|
1204
|
-
)
|
|
1205
|
-
|
|
1206
|
-
else:
|
|
1207
|
-
raise ValueError(
|
|
1208
|
-
f"There is already an event "
|
|
1209
|
-
f"{dict_of_events[start_this_event]} at {start_this_event}."
|
|
1210
|
-
)
|
|
1211
|
-
|
|
1212
|
-
continue
|
|
1213
|
-
|
|
1214
1191
|
dict_of_events[start_this_event] = {
|
|
1215
1192
|
"type": type(process).__name__,
|
|
1216
1193
|
"area": current_area.ID,
|
|
@@ -1460,8 +1437,6 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
|
|
|
1460
1437
|
|
|
1461
1438
|
:return: None. The results are added to the database.
|
|
1462
1439
|
"""
|
|
1463
|
-
logger = logging.getLogger(__name__)
|
|
1464
|
-
|
|
1465
1440
|
# Process all the STANDBY (waiting) events #
|
|
1466
1441
|
all_waiting_starts = (
|
|
1467
1442
|
session.query(Event)
|
|
@@ -1488,7 +1463,7 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
|
|
|
1488
1463
|
), f"Number of waiting events starts {len(all_waiting_starts)} is not equal to the number of waiting event ends"
|
|
1489
1464
|
|
|
1490
1465
|
if len(all_waiting_starts) == 0:
|
|
1491
|
-
|
|
1466
|
+
print(
|
|
1492
1467
|
"No waiting events found. The depot has enough capacity for waiting. Change the waiting area capacity to 10 as buffer."
|
|
1493
1468
|
)
|
|
1494
1469
|
|
|
@@ -1519,7 +1494,7 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
|
|
|
1519
1494
|
waiting_area_id = all_waiting_starts[0].area_id
|
|
1520
1495
|
waiting_area = session.query(Area).filter(Area.id == waiting_area_id).first()
|
|
1521
1496
|
if waiting_area.capacity > peak_waiting_occupancy:
|
|
1522
|
-
|
|
1497
|
+
warnings.warn(
|
|
1523
1498
|
f"Current waiting area capacity {waiting_area.capacity} "
|
|
1524
1499
|
f"is greater than the peak waiting occupancy. Updating the capacity to {peak_waiting_occupancy}."
|
|
1525
1500
|
)
|
eflips/depot/api/private/util.py
CHANGED
|
@@ -130,11 +130,7 @@ def repeat_vehicle_schedules(
|
|
|
130
130
|
|
|
131
131
|
for vehicle_schedule in vehicle_schedules:
|
|
132
132
|
schedule_list_backward.append(vehicle_schedule.repeat(-repetition_period))
|
|
133
|
-
|
|
134
|
-
# For daily schedules, repeat the schedule backward twice for the stability of the results
|
|
135
|
-
schedule_list_backward.append(
|
|
136
|
-
vehicle_schedule.repeat(-2 * repetition_period)
|
|
137
|
-
)
|
|
133
|
+
schedule_list_backward.append(vehicle_schedule.repeat(-2 * repetition_period))
|
|
138
134
|
|
|
139
135
|
schedule_list_forward.append(vehicle_schedule.repeat(repetition_period))
|
|
140
136
|
|
|
@@ -180,7 +176,9 @@ def start_and_end_times(vehicle_schedules) -> Tuple[datetime, int]:
|
|
|
180
176
|
|
|
181
177
|
def check_depot_validity(depot: Depot) -> None:
|
|
182
178
|
"""
|
|
183
|
-
Check if the depot is valid for the eflips-depot simulation.
|
|
179
|
+
Check if the depot is valid for the eflips-depot simulation.
|
|
180
|
+
|
|
181
|
+
Raise an AssertionError if it is not.
|
|
184
182
|
:param depot: a :class:`eflips.model.Depot` object.
|
|
185
183
|
:return: None
|
|
186
184
|
"""
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
eflips/depot/__init__.py,sha256=n7jte8R6j_Ad4Mp4hkklKwil5r8u8Q_SbXrCC-nf5jM,1556
|
|
2
|
-
eflips/depot/api/__init__.py,sha256=
|
|
2
|
+
eflips/depot/api/__init__.py,sha256=iAGL9CPL2pjs0ol3VW0jCokvYa-OZqnwdjfq07wpMvw,66734
|
|
3
3
|
eflips/depot/api/defaults/default_settings.json,sha256=0eUDTw_rtLQFvthP8oJL93iRXlmAOravAg-4qqGMQAY,5375
|
|
4
4
|
eflips/depot/api/private/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
eflips/depot/api/private/depot.py,sha256=pgLk9rdjZthk35vKCTmcl4VfjYQJRnqR-CPGwBs_9zk,18111
|
|
6
6
|
eflips/depot/api/private/smart_charging.py,sha256=JqYlUv_TnEqnp1Ks3FV3Od2rkYMOSORfUhrxZ49lUyE,13775
|
|
7
|
-
eflips/depot/api/private/util.py,sha256=
|
|
7
|
+
eflips/depot/api/private/util.py,sha256=LtDIW904chDby9ERmvbVum5YtOZXi1OmN4a2SszmIfs,16834
|
|
8
8
|
eflips/depot/configuration.py,sha256=Op3hlir-dEN7yHr0kTqbYANoCBKFWK6uKOv3NJl8w_w,35678
|
|
9
9
|
eflips/depot/depot.py,sha256=afIlaiX-J-M5-K_oAGMr_soL3_QjIAwrQKDaZzTwle0,105566
|
|
10
10
|
eflips/depot/evaluation.py,sha256=qqXyP4jA1zFcKuWhliQ6n25ZlGl9mJV-vtXf0yu8WN8,140842
|
|
@@ -35,7 +35,7 @@ eflips/depot/simulation.py,sha256=ee0qTzOzG-8ybN36ie_NJallXfC7jUaS9JZvaYFziLs,10
|
|
|
35
35
|
eflips/depot/smart_charging.py,sha256=C3BYqzn2-OYY4ipXm0ETtavbAM9QXZMYULBpVoChf0E,54311
|
|
36
36
|
eflips/depot/standalone.py,sha256=VxcTzBaB67fNJUMmjPRwKXjhqTy6oQ41Coote2LvAmk,22338
|
|
37
37
|
eflips/depot/validation.py,sha256=TIuY7cQtEJI4H2VVMSuY5IIVkacEEZ67weeMuY3NSAM,7097
|
|
38
|
-
eflips_depot-4.
|
|
39
|
-
eflips_depot-4.
|
|
40
|
-
eflips_depot-4.
|
|
41
|
-
eflips_depot-4.
|
|
38
|
+
eflips_depot-4.3.1.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
39
|
+
eflips_depot-4.3.1.dist-info/METADATA,sha256=16VRLrJjzOpO0C_BvhQlohKOQ1DMlflFLeJNLWm4DXs,5839
|
|
40
|
+
eflips_depot-4.3.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
41
|
+
eflips_depot-4.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|