eflips-depot 4.11.0__py3-none-any.whl → 4.12.0__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 +29 -11
- {eflips_depot-4.11.0.dist-info → eflips_depot-4.12.0.dist-info}/METADATA +3 -3
- {eflips_depot-4.11.0.dist-info → eflips_depot-4.12.0.dist-info}/RECORD +5 -5
- {eflips_depot-4.11.0.dist-info → eflips_depot-4.12.0.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.11.0.dist-info → eflips_depot-4.12.0.dist-info}/WHEEL +0 -0
eflips/depot/api/__init__.py
CHANGED
|
@@ -124,7 +124,8 @@ def generate_consumption_result(scenario):
|
|
|
124
124
|
Generate consumption information for the scenario.
|
|
125
125
|
|
|
126
126
|
This function retrieves the consumption LUT and vehicle classes from the database and returns a dictionary
|
|
127
|
-
containing the consumption information for each vehicle type in the scenario.
|
|
127
|
+
containing the consumption information for each vehicle type in the scenario. If a trip has no corresponding
|
|
128
|
+
consumption LUT, it won't be included in the results.
|
|
128
129
|
|
|
129
130
|
:param scenario: A :class:`eflips.model.Scenario` object containing the input data for the simulation.
|
|
130
131
|
|
|
@@ -135,10 +136,18 @@ def generate_consumption_result(scenario):
|
|
|
135
136
|
trips = session.query(Trip).filter(Trip.scenario_id == scenario.id).all()
|
|
136
137
|
consumption_results = {}
|
|
137
138
|
for trip in trips:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
try:
|
|
140
|
+
consumption_info = extract_trip_information(
|
|
141
|
+
trip.id,
|
|
142
|
+
scenario,
|
|
143
|
+
)
|
|
144
|
+
except ValueError as e:
|
|
145
|
+
# If the trip has no consumption information, skip it
|
|
146
|
+
logging.warning(
|
|
147
|
+
f"Skipping trip {trip.id} due to missing consumption information: {e}"
|
|
148
|
+
)
|
|
149
|
+
continue
|
|
150
|
+
|
|
142
151
|
battery_capacity_current_vt = trip.rotation.vehicle_type.battery_capacity
|
|
143
152
|
consumption_result = consumption_info.generate_consumption_result(
|
|
144
153
|
battery_capacity_current_vt
|
|
@@ -1102,7 +1111,7 @@ def generate_depot_optimal_size(
|
|
|
1102
1111
|
charging_power: float = 90,
|
|
1103
1112
|
database_url: Optional[str] = None,
|
|
1104
1113
|
delete_existing_depot: bool = False,
|
|
1105
|
-
|
|
1114
|
+
use_consumption_lut: bool = False,
|
|
1106
1115
|
) -> None:
|
|
1107
1116
|
"""
|
|
1108
1117
|
Generates an optimal depot layout with the smallest possible size for each depot in the scenario. Line charging areas
|
|
@@ -1114,8 +1123,8 @@ def generate_depot_optimal_size(
|
|
|
1114
1123
|
:param database_url: An optional database URL. Used if no database url is given by the environment variable.
|
|
1115
1124
|
:param delete_existing_depot: If there is already a depot existing in this scenario, set True to delete this
|
|
1116
1125
|
existing depot. Set to False and a ValueError will be raised if there is a depot in this scenario.
|
|
1117
|
-
:param
|
|
1118
|
-
|
|
1126
|
+
:param using_consumption_lut: If True, the depot layout will be generated based on the consumption lookup table.
|
|
1127
|
+
If False, constant consumption stored in VehicleType table will be used.
|
|
1119
1128
|
|
|
1120
1129
|
:return: None. The depot layout will be added to the database.
|
|
1121
1130
|
|
|
@@ -1139,9 +1148,18 @@ def generate_depot_optimal_size(
|
|
|
1139
1148
|
|
|
1140
1149
|
##### Step 0: Consumption Simulation #####
|
|
1141
1150
|
# Run the consumption simulation for all depots
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1151
|
+
|
|
1152
|
+
if use_consumption_lut:
|
|
1153
|
+
# If using the consumption lookup table, we need to calculate the consumption results
|
|
1154
|
+
consumption_results = generate_consumption_result(scenario)
|
|
1155
|
+
simple_consumption_simulation(
|
|
1156
|
+
scenario,
|
|
1157
|
+
initialize_vehicles=True,
|
|
1158
|
+
consumption_result=consumption_results,
|
|
1159
|
+
)
|
|
1160
|
+
else:
|
|
1161
|
+
# If not using the consumption lookup table, we need to initialize the vehicles with the constant consumption
|
|
1162
|
+
simple_consumption_simulation(scenario, initialize_vehicles=True)
|
|
1145
1163
|
|
|
1146
1164
|
##### Step 1: Find all potential depots #####
|
|
1147
1165
|
# These are all the spots where a rotation starts and end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: eflips-depot
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.12.0
|
|
4
4
|
Summary: Depot Simulation for eFLIPS
|
|
5
5
|
License: AGPL-3.0-or-later
|
|
6
6
|
Author: Enrico Lauth
|
|
@@ -13,8 +13,8 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Requires-Dist: eflips (>=0.1.3,<0.2.0)
|
|
16
|
-
Requires-Dist: eflips-model (
|
|
17
|
-
Requires-Dist: eflips-opt (>=0.3.
|
|
16
|
+
Requires-Dist: eflips-model (>8.1.0,<10.0.0)
|
|
17
|
+
Requires-Dist: eflips-opt (>=0.3.3,<0.4.0)
|
|
18
18
|
Requires-Dist: pandas (>=2.2.0,<3.0.0)
|
|
19
19
|
Requires-Dist: scipy (>=1.14.0,<2.0.0)
|
|
20
20
|
Requires-Dist: simpy (>=4.0.1,<5.0.0)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
eflips/depot/__init__.py,sha256=06GUem0JIEunIyJ0_P_MLAGfibGEnNqcPPY0OBpO2NQ,1662
|
|
2
|
-
eflips/depot/api/__init__.py,sha256=
|
|
2
|
+
eflips/depot/api/__init__.py,sha256=t153i_ZJA82O5w7GSY3-NAz8sSDI4mLZdjKrroFu_-M,54945
|
|
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/consumption.py,sha256=nImegyhKrZlEwKTNdmAmDxjTQCvwfPgxA588e0M_F9o,27282
|
|
@@ -36,7 +36,7 @@ eflips/depot/simulation.py,sha256=ee0qTzOzG-8ybN36ie_NJallXfC7jUaS9JZvaYFziLs,10
|
|
|
36
36
|
eflips/depot/smart_charging.py,sha256=C3BYqzn2-OYY4ipXm0ETtavbAM9QXZMYULBpVoChf0E,54311
|
|
37
37
|
eflips/depot/standalone.py,sha256=8O01zEXghFG9zZBu0fUD0sXvbHQ-AXw6RB5M750a_sM,22419
|
|
38
38
|
eflips/depot/validation.py,sha256=TIuY7cQtEJI4H2VVMSuY5IIVkacEEZ67weeMuY3NSAM,7097
|
|
39
|
-
eflips_depot-4.
|
|
40
|
-
eflips_depot-4.
|
|
41
|
-
eflips_depot-4.
|
|
42
|
-
eflips_depot-4.
|
|
39
|
+
eflips_depot-4.12.0.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
40
|
+
eflips_depot-4.12.0.dist-info/METADATA,sha256=IhvhXaJwVlfImiFwOdf4RTAH7rTmMnpabfsogv18mO8,5985
|
|
41
|
+
eflips_depot-4.12.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
42
|
+
eflips_depot-4.12.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|