eflips-depot 4.3.6__py3-none-any.whl → 4.3.7__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-4.3.6.dist-info → eflips_depot-4.3.7.dist-info}/METADATA +1 -1
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.7.dist-info}/RECORD +5 -5
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.7.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.3.6.dist-info → eflips_depot-4.3.7.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
|
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
@@ -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.7.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
39
|
+
eflips_depot-4.3.7.dist-info/METADATA,sha256=8OdRATPcaCLTdBCag46dA-vZJQJVScvoL9hSnTOXU2E,5839
|
|
40
|
+
eflips_depot-4.3.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
41
|
+
eflips_depot-4.3.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|