eflips-depot 4.3.6__py3-none-any.whl → 4.3.8__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 +20 -8
- eflips/depot/depot.py +15 -9
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.8.dist-info}/METADATA +1 -1
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.8.dist-info}/RECORD +6 -6
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.8.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.8.dist-info}/WHEEL +0 -0
eflips/depot/api/__init__.py
CHANGED
|
@@ -35,8 +35,7 @@ from dataclasses import dataclass
|
|
|
35
35
|
from datetime import timedelta
|
|
36
36
|
from enum import Enum
|
|
37
37
|
from math import ceil
|
|
38
|
-
from
|
|
39
|
-
from typing import Any, Dict, Optional, Tuple, Union, List
|
|
38
|
+
from typing import Any, Dict, Optional, Union, List
|
|
40
39
|
|
|
41
40
|
import numpy as np
|
|
42
41
|
import sqlalchemy.orm
|
|
@@ -55,6 +54,7 @@ from eflips.model import (
|
|
|
55
54
|
Vehicle,
|
|
56
55
|
VehicleType,
|
|
57
56
|
)
|
|
57
|
+
from eflips.model import Process
|
|
58
58
|
from sqlalchemy.orm import Session
|
|
59
59
|
from sqlalchemy.sql import select
|
|
60
60
|
|
|
@@ -803,6 +803,9 @@ def generate_realistic_depot_layout(
|
|
|
803
803
|
|
|
804
804
|
# STEP 3: Put "all direct" depots at these spots and find the vehicle counts
|
|
805
805
|
depot_stations = []
|
|
806
|
+
vehicle_type_rotation_dict_by_station: Dict[
|
|
807
|
+
Station, Dict[VehicleType, List[Rotation]]
|
|
808
|
+
] = dict()
|
|
806
809
|
for (
|
|
807
810
|
first_last_stop_tup,
|
|
808
811
|
vehicle_type_rotation_dict,
|
|
@@ -811,6 +814,11 @@ def generate_realistic_depot_layout(
|
|
|
811
814
|
if first_stop != last_stop:
|
|
812
815
|
raise ValueError("First and last stop of a rotation are not the same.")
|
|
813
816
|
depot_stations.append(first_stop)
|
|
817
|
+
vehicle_type_rotation_dict_by_station[
|
|
818
|
+
first_stop
|
|
819
|
+
] = vehicle_type_rotation_dict
|
|
820
|
+
|
|
821
|
+
del first_last_stop_tup, vehicle_type_rotation_dict
|
|
814
822
|
|
|
815
823
|
all_direct_counts: Dict[
|
|
816
824
|
Station, Dict[VehicleType, int]
|
|
@@ -820,7 +828,7 @@ def generate_realistic_depot_layout(
|
|
|
820
828
|
stations=depot_stations,
|
|
821
829
|
scenario=scenario,
|
|
822
830
|
session=session,
|
|
823
|
-
|
|
831
|
+
vehicle_type_dict_by_station=vehicle_type_rotation_dict_by_station,
|
|
824
832
|
shunting_duration=shunting_duration,
|
|
825
833
|
)
|
|
826
834
|
|
|
@@ -847,7 +855,9 @@ def generate_realistic_depot_layout(
|
|
|
847
855
|
direct_counts=direct_counts,
|
|
848
856
|
line_counts=line_counts,
|
|
849
857
|
line_length=line_length,
|
|
850
|
-
vehicle_type_rotation_dict=
|
|
858
|
+
vehicle_type_rotation_dict=vehicle_type_rotation_dict_by_station[
|
|
859
|
+
station
|
|
860
|
+
],
|
|
851
861
|
shunting_duration=shunting_duration,
|
|
852
862
|
)
|
|
853
863
|
|
|
@@ -926,7 +936,9 @@ def generate_realistic_depot_layout(
|
|
|
926
936
|
direct_counts=direct_counts,
|
|
927
937
|
line_counts=line_counts,
|
|
928
938
|
line_length=line_length,
|
|
929
|
-
vehicle_type_rotation_dict=
|
|
939
|
+
vehicle_type_rotation_dict=vehicle_type_rotation_dict_by_station[
|
|
940
|
+
station
|
|
941
|
+
],
|
|
930
942
|
shunting_duration=shunting_duration,
|
|
931
943
|
)
|
|
932
944
|
|
|
@@ -937,7 +949,7 @@ def vehicle_counts_for_direct_layout(
|
|
|
937
949
|
stations: List[Station],
|
|
938
950
|
scenario: Scenario,
|
|
939
951
|
session: sqlalchemy.orm.session.Session,
|
|
940
|
-
|
|
952
|
+
vehicle_type_dict_by_station: Dict[Station, Dict[VehicleType, List[Rotation]]],
|
|
941
953
|
shunting_duration: timedelta = timedelta(minutes=5),
|
|
942
954
|
) -> Dict[Station, Dict[VehicleType, int]]:
|
|
943
955
|
"""
|
|
@@ -959,7 +971,7 @@ def vehicle_counts_for_direct_layout(
|
|
|
959
971
|
# Generate the depot
|
|
960
972
|
direct_counts = {}
|
|
961
973
|
line_counts = {}
|
|
962
|
-
for vehicle_type, rotations in
|
|
974
|
+
for vehicle_type, rotations in vehicle_type_dict_by_station[station].items():
|
|
963
975
|
direct_counts[vehicle_type] = len(rotations)
|
|
964
976
|
line_counts[vehicle_type] = 1
|
|
965
977
|
|
|
@@ -972,7 +984,7 @@ def vehicle_counts_for_direct_layout(
|
|
|
972
984
|
direct_counts=direct_counts,
|
|
973
985
|
line_counts=line_counts,
|
|
974
986
|
line_length=8, # We don't care about the line length here
|
|
975
|
-
vehicle_type_rotation_dict=
|
|
987
|
+
vehicle_type_rotation_dict=vehicle_type_dict_by_station[station],
|
|
976
988
|
shunting_duration=shunting_duration,
|
|
977
989
|
)
|
|
978
990
|
|
eflips/depot/depot.py
CHANGED
|
@@ -7,14 +7,14 @@ Created on Fri Oct 13 11:12:00 2017.
|
|
|
7
7
|
Core components of the depot simulation model.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
+
from abc import ABC, abstractmethod
|
|
10
11
|
from collections import Counter
|
|
12
|
+
from warnings import warn
|
|
13
|
+
|
|
11
14
|
import simpy
|
|
12
|
-
from simpy.resources.store import StorePut
|
|
13
|
-
from simpy.core import BoundClass
|
|
14
|
-
from simpy.util import start_delayed
|
|
15
15
|
from eflips.evaluation import DataLogger
|
|
16
|
-
from eflips.settings import globalConstants
|
|
17
16
|
from eflips.helperFunctions import flexprint, SortedList
|
|
17
|
+
from eflips.settings import globalConstants
|
|
18
18
|
from eflips.simpy_ext import (
|
|
19
19
|
FilterStoreExt,
|
|
20
20
|
PositionalFilterStore,
|
|
@@ -26,18 +26,20 @@ from eflips.simpy_ext import (
|
|
|
26
26
|
LineFilterStoreGet,
|
|
27
27
|
ExclusiveRequest,
|
|
28
28
|
)
|
|
29
|
-
from
|
|
30
|
-
from
|
|
29
|
+
from simpy.core import BoundClass
|
|
30
|
+
from simpy.resources.store import StorePut
|
|
31
|
+
from simpy.util import start_delayed
|
|
32
|
+
|
|
33
|
+
from eflips.depot.evaluation import Departure, ProcessCalled
|
|
31
34
|
from eflips.depot.filters import VehicleFilter
|
|
35
|
+
from eflips.depot.processes import EstimateValue, ChargeAbstract, Precondition
|
|
32
36
|
from eflips.depot.rating import (
|
|
33
37
|
SlotAlternative,
|
|
34
38
|
ParkRating,
|
|
35
39
|
VehicleAlternative,
|
|
36
40
|
DispatchRating,
|
|
37
41
|
)
|
|
38
|
-
from eflips.depot.
|
|
39
|
-
from abc import ABC, abstractmethod
|
|
40
|
-
from warnings import warn
|
|
42
|
+
from eflips.depot.resources import DepotChargingInterface
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
class DepotWorkingData:
|
|
@@ -869,6 +871,10 @@ class DSSmart(BaseDispatchStrategy):
|
|
|
869
871
|
|
|
870
872
|
for parking_area_group in depot.parking_area_groups:
|
|
871
873
|
for area in parking_area_group.stores:
|
|
874
|
+
# Speedup: Skip empty areas
|
|
875
|
+
if all([item is None for item in area.items]):
|
|
876
|
+
continue
|
|
877
|
+
|
|
872
878
|
if isinstance(area, LineArea):
|
|
873
879
|
# Add one vehicle at max. at Line area
|
|
874
880
|
rg = area.range_from_side(area.side_get_default)
|
|
@@ -1,12 +1,12 @@
|
|
|
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=6voBU0iXtWsIRecVNwI6qF6VVu1w6X-sGrNYZJqWEoA,94478
|
|
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=IpXQR2GuEUuilP02njKpvExgSkktkyHPmcn2j_Q3YPk,21276
|
|
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
|
|
9
|
-
eflips/depot/depot.py,sha256=
|
|
9
|
+
eflips/depot/depot.py,sha256=w-5kurK-1ztEYHATHGSD0j3qBI96nM4dHfoc8OErfd8,105705
|
|
10
10
|
eflips/depot/evaluation.py,sha256=qqXyP4jA1zFcKuWhliQ6n25ZlGl9mJV-vtXf0yu8WN8,140842
|
|
11
11
|
eflips/depot/filters.py,sha256=52esFT_kldMC9-LteY4CFe8BETwr0bn-CacegVe6jsA,16131
|
|
12
12
|
eflips/depot/input_epex_power_price.py,sha256=VPDC1zy-klQpveGIZ8941hL1P_jeNq3IHoLgFTsANig,5569
|
|
@@ -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.8.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
39
|
+
eflips_depot-4.3.8.dist-info/METADATA,sha256=utmVXHhrJTkZY0vrilXVw6aJkp7XOzzPIVsbJdvEauY,5839
|
|
40
|
+
eflips_depot-4.3.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
41
|
+
eflips_depot-4.3.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|