nextroute 1.10.1__tar.gz → 1.11.0__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.
Potentially problematic release.
This version of nextroute might be problematic. Click here for more details.
- {nextroute-1.10.1/src/nextroute.egg-info → nextroute-1.11.0}/PKG-INFO +1 -1
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/__about__.py +1 -1
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/bin/nextroute.exe +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/options.py +12 -0
- {nextroute-1.10.1 → nextroute-1.11.0/src/nextroute.egg-info}/PKG-INFO +1 -1
- {nextroute-1.10.1 → nextroute-1.11.0}/src/tests/solve_golden/main.py +15 -11
- {nextroute-1.10.1 → nextroute-1.11.0}/LICENSE +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/README.md +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/pyproject.toml +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/setup.cfg +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/setup.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/__init__.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/base_model.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/check/__init__.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/check/schema.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/__init__.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/input.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/location.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/output.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/statistics.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/stop.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/schema/vehicle.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/solve.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute/version.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute.egg-info/SOURCES.txt +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute.egg-info/dependency_links.txt +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute.egg-info/requires.txt +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/nextroute.egg-info/top_level.txt +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/tests/schema/__init__.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/tests/schema/test_input.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/tests/schema/test_output.py +0 -0
- {nextroute-1.10.1 → nextroute-1.11.0}/src/tests/solve_golden/__init__.py +0 -0
|
Binary file
|
|
@@ -89,6 +89,8 @@ class Options(BaseModel):
|
|
|
89
89
|
"""Factor to weigh the late arrival objective."""
|
|
90
90
|
MODEL_OBJECTIVES_MINSTOPS: float = 1.0
|
|
91
91
|
"""Factor to weigh the min stops objective."""
|
|
92
|
+
MODEL_OBJECTIVES_STOPBALANCE: float = 0.0
|
|
93
|
+
"""Factor to weigh the stop balance objective."""
|
|
92
94
|
MODEL_OBJECTIVES_TRAVELDURATION: float = 0.0
|
|
93
95
|
"""Factor to weigh the travel duration objective."""
|
|
94
96
|
MODEL_OBJECTIVES_UNPLANNEDPENALTY: float = 1.0
|
|
@@ -105,6 +107,8 @@ class Options(BaseModel):
|
|
|
105
107
|
"""Ignore the initial solution."""
|
|
106
108
|
MODEL_PROPERTIES_DISABLE_STOPDURATIONMULTIPLIERS: bool = False
|
|
107
109
|
"""Ignore the stop duration multipliers defined on vehicles."""
|
|
110
|
+
MODEL_PROPERTIES_MAXIMUMTIMEHORIZON: int = 15552000
|
|
111
|
+
"""Maximum time horizon for the model in seconds."""
|
|
108
112
|
MODEL_VALIDATE_DISABLE_RESOURCES: bool = False
|
|
109
113
|
"""Disable the resources validation."""
|
|
110
114
|
MODEL_VALIDATE_DISABLE_STARTTIME: bool = False
|
|
@@ -125,6 +129,14 @@ class Options(BaseModel):
|
|
|
125
129
|
Maximum number of parallel runs, -1 results in using all available
|
|
126
130
|
resources.
|
|
127
131
|
"""
|
|
132
|
+
SOLVE_PLATEAU_ABSOLUTETHRESHOLD: float = -1
|
|
133
|
+
"""Absolute threshold for significant improvement."""
|
|
134
|
+
SOLVE_PLATEAU_DURATION: float = 0
|
|
135
|
+
"""Maximum duration without (significant) improvement."""
|
|
136
|
+
SOLVE_PLATEAU_ITERATIONS: int = 0
|
|
137
|
+
"""Maximum number of iterations without (significant) improvement."""
|
|
138
|
+
SOLVE_PLATEAU_RELATIVETHRESHOLD: float = 0
|
|
139
|
+
"""Relative threshold for significant improvement."""
|
|
128
140
|
SOLVE_RUNDETERMINISTICALLY: bool = False
|
|
129
141
|
"""Run the parallel solver deterministically."""
|
|
130
142
|
SOLVE_STARTSOLUTIONS: int = -1
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# This script is copied to the `src` root so that the `nextroute` import is
|
|
2
2
|
# resolved. It is fed an input via stdin and is meant to write the output to
|
|
3
3
|
# stdout.
|
|
4
|
-
from typing import Any, Dict
|
|
5
|
-
|
|
6
4
|
import nextmv
|
|
7
5
|
|
|
8
6
|
import nextroute
|
|
@@ -16,8 +14,8 @@ def main() -> None:
|
|
|
16
14
|
nextmv.Parameter("output", str, "", "Path to output file. Default is stdout.", False),
|
|
17
15
|
]
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
for name, default_value in
|
|
17
|
+
default_options = nextroute.Options()
|
|
18
|
+
for name, default_value in default_options.to_dict().items():
|
|
21
19
|
parameters.append(nextmv.Parameter(name.lower(), type(default_value), default_value, name, False))
|
|
22
20
|
|
|
23
21
|
options = nextmv.Options(*parameters)
|
|
@@ -28,18 +26,24 @@ def main() -> None:
|
|
|
28
26
|
nextmv.log(f" - stops: {len(input.data.get('stops', []))}")
|
|
29
27
|
nextmv.log(f" - vehicles: {len(input.data.get('vehicles', []))}")
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
model = DecisionModel()
|
|
30
|
+
output = model.solve(input)
|
|
32
31
|
nextmv.write_local(output, path=options.output)
|
|
33
32
|
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
class DecisionModel(nextmv.Model):
|
|
35
|
+
def solve(self, input: nextmv.Input) -> nextmv.Output:
|
|
36
|
+
"""Solves the given problem and returns the solution."""
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
nextroute_input = nextroute.schema.Input.from_dict(input.data)
|
|
39
|
+
nextroute_options = nextroute.Options.extract_from_dict(input.options.to_dict())
|
|
40
|
+
nextroute_output = nextroute.solve(nextroute_input, nextroute_options)
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
return nextmv.Output(
|
|
43
|
+
options=input.options,
|
|
44
|
+
solution=nextroute_output.solutions[0].to_dict(),
|
|
45
|
+
statistics=nextroute_output.statistics.to_dict(),
|
|
46
|
+
)
|
|
43
47
|
|
|
44
48
|
|
|
45
49
|
if __name__ == "__main__":
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|