eflips-depot 4.3.11__py3-none-any.whl → 4.3.13__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.
Potentially problematic release.
This version of eflips-depot might be problematic. Click here for more details.
- eflips/depot/api/__init__.py +2 -2
- eflips/depot/api/private/depot.py +1 -2
- eflips/depot/processes.py +2 -2
- eflips/depot/rating.py +40 -53
- {eflips_depot-4.3.11.dist-info → eflips_depot-4.3.13.dist-info}/METADATA +1 -1
- {eflips_depot-4.3.11.dist-info → eflips_depot-4.3.13.dist-info}/RECORD +8 -8
- {eflips_depot-4.3.11.dist-info → eflips_depot-4.3.13.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.3.11.dist-info → eflips_depot-4.3.13.dist-info}/WHEEL +0 -0
eflips/depot/api/__init__.py
CHANGED
|
@@ -973,7 +973,7 @@ def vehicle_counts_for_direct_layout(
|
|
|
973
973
|
line_counts = {}
|
|
974
974
|
for vehicle_type, rotations in vehicle_type_dict_by_station[station].items():
|
|
975
975
|
direct_counts[vehicle_type] = len(rotations)
|
|
976
|
-
line_counts[vehicle_type] =
|
|
976
|
+
line_counts[vehicle_type] = 0
|
|
977
977
|
|
|
978
978
|
generate_line_depot_layout(
|
|
979
979
|
CLEAN_DURATION=CLEAN_DURATION,
|
|
@@ -2091,7 +2091,7 @@ def _add_events_into_database(
|
|
|
2091
2091
|
vehicle=db_vehicle,
|
|
2092
2092
|
station_id=None,
|
|
2093
2093
|
area_id=int(process_dict["area"]),
|
|
2094
|
-
subloc_no=int(process_dict["slot"])
|
|
2094
|
+
subloc_no=int(process_dict["slot"]) - 1
|
|
2095
2095
|
if "slot" in process_dict.keys()
|
|
2096
2096
|
else 00,
|
|
2097
2097
|
trip_id=None,
|
|
@@ -7,7 +7,6 @@ from typing import Dict, List, Tuple
|
|
|
7
7
|
|
|
8
8
|
import eflips.model
|
|
9
9
|
import numpy as np
|
|
10
|
-
|
|
11
10
|
import sqlalchemy.orm
|
|
12
11
|
from eflips.model import (
|
|
13
12
|
Scenario,
|
|
@@ -235,7 +234,7 @@ def depot_to_template(depot: Depot) -> Dict[str, str | Dict[str, str | int]]:
|
|
|
235
234
|
"typename": "AreaGroup",
|
|
236
235
|
"stores": [str(area.id) for area in process.areas],
|
|
237
236
|
}
|
|
238
|
-
if process_type(process) == ProcessType.
|
|
237
|
+
if process_type(process) == ProcessType.CHARGING:
|
|
239
238
|
template["groups"][group_name]["typename"] = "ParkingAreaGroup"
|
|
240
239
|
template["groups"][group_name]["parking_strategy_name"] = "SMART2"
|
|
241
240
|
|
eflips/depot/processes.py
CHANGED
|
@@ -927,8 +927,8 @@ class Charge(ChargeAbstract):
|
|
|
927
927
|
# returned False
|
|
928
928
|
return 0
|
|
929
929
|
|
|
930
|
-
efficiency = chargedata["kwargs"]["efficiency"]
|
|
931
|
-
soc_target = chargedata["kwargs"]["soc_target"]
|
|
930
|
+
efficiency = 1 # chargedata["kwargs"]["efficiency"] TODO: Re-enable this
|
|
931
|
+
soc_target = 1 # chargedata["kwargs"]["soc_target"]
|
|
932
932
|
if soc_target == "soc_max":
|
|
933
933
|
soc_target = vehicle.battery.soc_max
|
|
934
934
|
|
eflips/depot/rating.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
"""
|
|
3
|
-
Components to model multi criteria decision problems.
|
|
4
|
-
dispatch strategies.
|
|
3
|
+
Components to model multi criteria decision problems.
|
|
5
4
|
|
|
5
|
+
Application for park- and
|
|
6
|
+
dispatch strategies.
|
|
6
7
|
"""
|
|
7
|
-
import numpy as np
|
|
8
8
|
from abc import ABC, abstractmethod
|
|
9
|
-
import eflips
|
|
10
9
|
|
|
10
|
+
import numpy as np
|
|
11
|
+
|
|
12
|
+
import eflips
|
|
11
13
|
|
|
12
14
|
# Settings
|
|
13
15
|
|
|
@@ -49,7 +51,6 @@ class Rating:
|
|
|
49
51
|
best_alternative_nos: [tuple] from np.where with the row indices of the
|
|
50
52
|
best alternatives in alternatives. E.g.: (array([2], dtype=int64),)
|
|
51
53
|
best_alternatives: [list] of the best alternatives.
|
|
52
|
-
|
|
53
54
|
"""
|
|
54
55
|
|
|
55
56
|
def __init__(self, alternatives, weights=None):
|
|
@@ -99,8 +100,8 @@ class Rating:
|
|
|
99
100
|
|
|
100
101
|
class BaseCriterion(ABC):
|
|
101
102
|
"""Base class for a criterion.
|
|
102
|
-
Subclasses must implement attibute 'value' and method 'calculate'.
|
|
103
103
|
|
|
104
|
+
Subclasses must implement attibute 'value' and method 'calculate'.
|
|
104
105
|
"""
|
|
105
106
|
|
|
106
107
|
@abstractmethod
|
|
@@ -110,8 +111,8 @@ class BaseCriterion(ABC):
|
|
|
110
111
|
|
|
111
112
|
class BufferPark(BaseCriterion):
|
|
112
113
|
"""Criterion for ParkRating.
|
|
113
|
-
Exclusive for Direct areas. Value is 0 for Line.
|
|
114
114
|
|
|
115
|
+
Exclusive for Direct areas. Value is 0 for Line.
|
|
115
116
|
"""
|
|
116
117
|
|
|
117
118
|
def __init__(self, area, vehicle):
|
|
@@ -128,33 +129,28 @@ class BufferPark(BaseCriterion):
|
|
|
128
129
|
if count_direct == 0:
|
|
129
130
|
return 1
|
|
130
131
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
count = sum(
|
|
146
|
-
sum(v.vehicle_type is vehicle.vehicle_type for v in a.items if v)
|
|
147
|
-
for a in area.parking_area_group.direct_areas
|
|
148
|
-
)
|
|
149
|
-
share_target = vehicle.vehicle_type.share[area.depot]
|
|
150
|
-
# print('lone. count: %d, share_target: %f' % (count, share_target))
|
|
132
|
+
# Find out how many charging spots in line areas there are for this vehicle type
|
|
133
|
+
# And how many vehicles are currently charging
|
|
134
|
+
total_line_area_capacity = 0
|
|
135
|
+
total_vehicles_charging = 0
|
|
136
|
+
for area in area.depot.parking_area_groups:
|
|
137
|
+
for store in area.stores_by_vehicle_type[vehicle.vehicle_type.ID]:
|
|
138
|
+
if len(store.charging_interfaces) > 0:
|
|
139
|
+
if isinstance(store, eflips.depot.LineArea):
|
|
140
|
+
total_line_area_capacity += len(store.charging_interfaces)
|
|
141
|
+
total_vehicles_charging += store.capacity - store.vacant
|
|
142
|
+
|
|
143
|
+
# If there are no line areas, we can only park there
|
|
144
|
+
if total_line_area_capacity == 0:
|
|
145
|
+
return 1
|
|
151
146
|
|
|
152
|
-
|
|
147
|
+
ratio_of_vehicles_in_line_areas = (
|
|
148
|
+
total_vehicles_charging / total_line_area_capacity
|
|
149
|
+
)
|
|
150
|
+
target_ratio = 0.3
|
|
151
|
+
print(ratio_of_vehicles_in_line_areas)
|
|
153
152
|
|
|
154
|
-
|
|
155
|
-
# print('BufferPark for vehicle %s: count=%s, total=%s, share=%s, share_target=%s'
|
|
156
|
-
# % (vehicle.ID, count, total_buffer_capacity, share, share_target))
|
|
157
|
-
if result:
|
|
153
|
+
if ratio_of_vehicles_in_line_areas < target_ratio:
|
|
158
154
|
return 1
|
|
159
155
|
else:
|
|
160
156
|
return 0
|
|
@@ -162,8 +158,8 @@ class BufferPark(BaseCriterion):
|
|
|
162
158
|
|
|
163
159
|
class TypestackPark(BaseCriterion):
|
|
164
160
|
"""Criterion for ParkRating.
|
|
165
|
-
Exclusive for Line areas. Value is 0 for Direct.
|
|
166
161
|
|
|
162
|
+
Exclusive for Line areas. Value is 0 for Direct.
|
|
167
163
|
"""
|
|
168
164
|
|
|
169
165
|
def __init__(self, area, vehicle):
|
|
@@ -184,11 +180,11 @@ class TypestackPark(BaseCriterion):
|
|
|
184
180
|
|
|
185
181
|
class RfdDiffPark(BaseCriterion):
|
|
186
182
|
"""Criterion for ParkRating.
|
|
183
|
+
|
|
187
184
|
Exclusive for Line areas where *vehicle* would be blocked. Value is 0 for
|
|
188
185
|
Direct.
|
|
189
186
|
|
|
190
187
|
slot: [tuple] with items (area, index of slot)
|
|
191
|
-
|
|
192
188
|
"""
|
|
193
189
|
|
|
194
190
|
lower_bound = rfd_diff_park_lower_bound
|
|
@@ -239,10 +235,10 @@ class RfdDiffPark(BaseCriterion):
|
|
|
239
235
|
|
|
240
236
|
class AvailablePower(BaseCriterion):
|
|
241
237
|
"""Criterion for ParkRating and DispatchRating.
|
|
238
|
+
|
|
242
239
|
For both Direct and Line areas.
|
|
243
240
|
|
|
244
241
|
slot: [tuple] with items (area, index of slot)
|
|
245
|
-
|
|
246
242
|
"""
|
|
247
243
|
|
|
248
244
|
def __init__(self, slot, max_power):
|
|
@@ -255,8 +251,8 @@ class AvailablePower(BaseCriterion):
|
|
|
255
251
|
|
|
256
252
|
class EmptySlotsExitPark(BaseCriterion):
|
|
257
253
|
"""Criterion for ParkRating.
|
|
258
|
-
Exclusive for Line areas. Value is 0 for Direct.
|
|
259
254
|
|
|
255
|
+
Exclusive for Line areas. Value is 0 for Direct.
|
|
260
256
|
"""
|
|
261
257
|
|
|
262
258
|
def __init__(self, area, max_capacity_line):
|
|
@@ -283,7 +279,6 @@ class SlotAlternative:
|
|
|
283
279
|
max_power: [int] maximum power in kW of all charging interfaces at parking
|
|
284
280
|
areas
|
|
285
281
|
max_capacity_line: [int or None] max capacity of Line parking areas
|
|
286
|
-
|
|
287
282
|
"""
|
|
288
283
|
|
|
289
284
|
def __init__(self, slot, vehicle, max_power, max_capacity_line):
|
|
@@ -320,11 +315,7 @@ class SlotAlternative:
|
|
|
320
315
|
|
|
321
316
|
|
|
322
317
|
class ParkRating(Rating):
|
|
323
|
-
"""
|
|
324
|
-
|
|
325
|
-
alternatives_obj: [list] of SlotAlternative instances
|
|
326
|
-
|
|
327
|
-
"""
|
|
318
|
+
"""Alternatives_obj: [list] of SlotAlternative instances."""
|
|
328
319
|
|
|
329
320
|
weights = [
|
|
330
321
|
park_rating_weights["buffer"],
|
|
@@ -346,8 +337,8 @@ class ParkRating(Rating):
|
|
|
346
337
|
|
|
347
338
|
class BufferDispatch(BaseCriterion):
|
|
348
339
|
"""Criterion for DispatchRating.
|
|
349
|
-
Exclusive for Direct areas. Value is 0 for Line.
|
|
350
340
|
|
|
341
|
+
Exclusive for Direct areas. Value is 0 for Line.
|
|
351
342
|
"""
|
|
352
343
|
|
|
353
344
|
def __init__(self, area, vehicle):
|
|
@@ -362,8 +353,8 @@ class BufferDispatch(BaseCriterion):
|
|
|
362
353
|
|
|
363
354
|
class TypestackDispatch(BaseCriterion):
|
|
364
355
|
"""Criterion for DispatchRating.
|
|
365
|
-
Exclusive for Line areas. Value is 0 for Direct.
|
|
366
356
|
|
|
357
|
+
Exclusive for Line areas. Value is 0 for Direct.
|
|
367
358
|
"""
|
|
368
359
|
|
|
369
360
|
def __init__(self, area):
|
|
@@ -389,12 +380,12 @@ class TypestackDispatch(BaseCriterion):
|
|
|
389
380
|
|
|
390
381
|
class RfdDiffDispatch:
|
|
391
382
|
"""Criterion for DispatchRating.
|
|
383
|
+
|
|
392
384
|
Exclusive for Line areas. Value is 0 for Direct.
|
|
393
385
|
|
|
394
386
|
slot: [tuple] with items (area, index of slot). Must contain a vehicle that
|
|
395
387
|
is ready for departure, i.e. dwd.etc_processes returns
|
|
396
388
|
eflips.EstimateValue.COMPLETED.
|
|
397
|
-
|
|
398
389
|
"""
|
|
399
390
|
|
|
400
391
|
upper_bound = rfd_diff_dispatch_upper_bound
|
|
@@ -421,7 +412,8 @@ class RfdDiffDispatch:
|
|
|
421
412
|
|
|
422
413
|
@staticmethod
|
|
423
414
|
def get_max_diff(slot):
|
|
424
|
-
"""Get the maximum of all etcs (estimated time of completion) of all
|
|
415
|
+
"""Get the maximum of all etcs (estimated time of completion) of all.
|
|
416
|
+
|
|
425
417
|
vehicles at the area of *slot* and return it as [int].
|
|
426
418
|
|
|
427
419
|
slot: [tuple] with items (area, index of slot)
|
|
@@ -449,8 +441,8 @@ class RfdDiffDispatch:
|
|
|
449
441
|
|
|
450
442
|
class EmptySlotsExitDispatch(BaseCriterion):
|
|
451
443
|
"""Criterion for DispatchRating.
|
|
452
|
-
Exclusive for Line areas. Value is 0 for Direct.
|
|
453
444
|
|
|
445
|
+
Exclusive for Line areas. Value is 0 for Direct.
|
|
454
446
|
"""
|
|
455
447
|
|
|
456
448
|
def __init__(self, area, max_capacity_line):
|
|
@@ -472,7 +464,6 @@ class VehicleAlternative:
|
|
|
472
464
|
max_power: [int] maximum power in kW of all charging interfaces at parking
|
|
473
465
|
areas
|
|
474
466
|
max_capacity_line: [int or None] max capacity of Line parking areas
|
|
475
|
-
|
|
476
467
|
"""
|
|
477
468
|
|
|
478
469
|
def __init__(self, slot, vehicle, max_power, max_capacity_line):
|
|
@@ -497,11 +488,7 @@ class VehicleAlternative:
|
|
|
497
488
|
|
|
498
489
|
|
|
499
490
|
class DispatchRating(Rating):
|
|
500
|
-
"""
|
|
501
|
-
|
|
502
|
-
alternatives_obj: [list] of VehicleAlternative instances
|
|
503
|
-
|
|
504
|
-
"""
|
|
491
|
+
"""Alternatives_obj: [list] of VehicleAlternative instances."""
|
|
505
492
|
|
|
506
493
|
weights = [
|
|
507
494
|
dispatch_rating_weights["buffer"],
|
|
@@ -1,8 +1,8 @@
|
|
|
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=CHmoF0TGEUuws-F6TglG2Kd8L3T-4j0PpUsPI7XbGYI,95668
|
|
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
|
-
eflips/depot/api/private/depot.py,sha256=
|
|
5
|
+
eflips/depot/api/private/depot.py,sha256=ZL1AwdrxD6Wn8i0oQPFL9z9NALcQ-ZKuKN0AC5nMWYU,21266
|
|
6
6
|
eflips/depot/api/private/smart_charging.py,sha256=LcD0SN26O6KPBL5Ha7tpovnMn_4dAi17Kb21jEeAoE0,13052
|
|
7
7
|
eflips/depot/api/private/util.py,sha256=Ye-WXNzHcNfunFijK7FCIU3AiCuMg83KnEhnKbtlZu8,17242
|
|
8
8
|
eflips/depot/configuration.py,sha256=Op3hlir-dEN7yHr0kTqbYANoCBKFWK6uKOv3NJl8w_w,35678
|
|
@@ -26,8 +26,8 @@ eflips/depot/layout_opt/settings.py,sha256=EUGCp4dAX22j2uF8sKqbi9a5iP8hb6QpP7t2N
|
|
|
26
26
|
eflips/depot/layout_opt/template_creation.py,sha256=H4LoFjQfbPjTt9rGvapH2tEUWcQ56kPwDucq7t6YahU,9736
|
|
27
27
|
eflips/depot/layout_opt/util.py,sha256=EYh7IN58ZjysmCFdSieQqIQ9goe1a_ZwARRHxOgjEQo,3780
|
|
28
28
|
eflips/depot/plots.py,sha256=85xInZWfJIOVm03onvppgP5yLTgQeMn-1t5aoNdavyY,2509
|
|
29
|
-
eflips/depot/processes.py,sha256=
|
|
30
|
-
eflips/depot/rating.py,sha256=
|
|
29
|
+
eflips/depot/processes.py,sha256=fC9Eoy1N8QC1D1r8hZnuHG3oeli5vth8DVfxsugtemM,58798
|
|
30
|
+
eflips/depot/rating.py,sha256=IMJP2_lHJeej2BE6eE2UPne8MPjEk8pvZWkhGOg1d50,16474
|
|
31
31
|
eflips/depot/resources.py,sha256=0SuzN8qgMmCqa7oUEXVC_XE6pCUtxTsqOfCsaM9Oh3o,13568
|
|
32
32
|
eflips/depot/settings_config.py,sha256=z7CqPdjd8QRlgZj0Zis-H13cL7LOiheRT4ctYCYGguc,2527
|
|
33
33
|
eflips/depot/simple_vehicle.py,sha256=Wl3IqYxMrs6J0U0iCrG3Qq8ONuDGoZ00r7h7svVyEik,9375
|
|
@@ -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.3.
|
|
39
|
-
eflips_depot-4.3.
|
|
40
|
-
eflips_depot-4.3.
|
|
41
|
-
eflips_depot-4.3.
|
|
38
|
+
eflips_depot-4.3.13.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
39
|
+
eflips_depot-4.3.13.dist-info/METADATA,sha256=1dziWnUPRK5YBci2UeptBR6mOuWq1z9qXfDFHurTWNc,5840
|
|
40
|
+
eflips_depot-4.3.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
41
|
+
eflips_depot-4.3.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|