eflips-depot 4.3.11__tar.gz → 4.3.13__tar.gz

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.
Files changed (41) hide show
  1. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/PKG-INFO +1 -1
  2. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/api/__init__.py +2 -2
  3. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/api/private/depot.py +1 -2
  4. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/processes.py +2 -2
  5. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/rating.py +40 -53
  6. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/pyproject.toml +1 -1
  7. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/LICENSE.md +0 -0
  8. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/README.md +0 -0
  9. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/__init__.py +0 -0
  10. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/api/defaults/default_settings.json +0 -0
  11. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/api/private/__init__.py +0 -0
  12. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/api/private/smart_charging.py +0 -0
  13. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/api/private/util.py +0 -0
  14. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/configuration.py +0 -0
  15. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/depot.py +0 -0
  16. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/evaluation.py +0 -0
  17. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/filters.py +0 -0
  18. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/input_epex_power_price.py +0 -0
  19. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/__init__.py +0 -0
  20. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/doc/__init__.py +0 -0
  21. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/doc/direct_details.pdf +0 -0
  22. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/evaluation.py +0 -0
  23. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/opt_tools/__init__.py +0 -0
  24. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/opt_tools/crossover.py +0 -0
  25. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/opt_tools/fitness_c_urfd.py +0 -0
  26. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/opt_tools/fitness_util.py +0 -0
  27. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/opt_tools/init.py +0 -0
  28. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/opt_tools/mutation.py +0 -0
  29. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/optimize_c_urfd.py +0 -0
  30. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/packing.py +0 -0
  31. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/settings.py +0 -0
  32. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/template_creation.py +0 -0
  33. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/layout_opt/util.py +0 -0
  34. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/plots.py +0 -0
  35. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/resources.py +0 -0
  36. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/settings_config.py +0 -0
  37. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/simple_vehicle.py +0 -0
  38. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/simulation.py +0 -0
  39. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/smart_charging.py +0 -0
  40. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/standalone.py +0 -0
  41. {eflips_depot-4.3.11 → eflips_depot-4.3.13}/eflips/depot/validation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eflips-depot
3
- Version: 4.3.11
3
+ Version: 4.3.13
4
4
  Summary: Depot Simulation for eFLIPS
5
5
  Home-page: https://github.com/mpm-tu-berlin/eflips-depot
6
6
  License: AGPL-3.0-or-later
@@ -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] = 1
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.STANDBY_DEPARTURE:
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
 
@@ -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
 
@@ -1,13 +1,15 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  """
3
- Components to model multi criteria decision problems. Application for park- and
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
- total_buffer_capacity = area.depot.parking_capacity_direct
132
-
133
- if vehicle.vehicle_type.group:
134
- count = sum(
135
- sum(
136
- v.vehicle_type.group is vehicle.vehicle_type.group
137
- for v in a.items
138
- if v
139
- )
140
- for a in area.parking_area_group.direct_areas
141
- )
142
- share_target = vehicle.vehicle_type.group.share[area.depot]
143
- # print('group. count: %d, share_target: %f' % (count, share_target))
144
- else:
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
- share = count / total_buffer_capacity
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
- result = share < share_target
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,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "eflips-depot"
3
- version = "4.3.11"
3
+ version = "4.3.13"
4
4
  description = "Depot Simulation for eFLIPS"
5
5
  authors = ["Enrico Lauth <enrico.lauth@tu-berlin.de>",
6
6
  "Ludger Heide <ludger.heide@tu-berlin.de",
File without changes
File without changes