diff --git a/factory/model.go b/factory/model.go index bfc9d02..68afc18 100644 --- a/factory/model.go +++ b/factory/model.go @@ -46,7 +46,7 @@ type Options struct { DurationGroups bool `json:"duration_groups" usage:"ignore the durations groups of stops"` InitialSolution bool `json:"initial_solution" usage:"ignore the initial solution"` } `json:"disable"` - MaximumTimeHorizon int `json:"maximum_time_horizon" usage:"maximum time horizon for the model in seconds" default:"2592000"` + MaximumTimeHorizon int `json:"maximum_time_horizon" usage:"maximum time horizon for the model in seconds" default:"15552000"` } `json:"properties"` Validate struct { Disable struct { diff --git a/go.mod b/go.mod index 556a09d..11ccbfb 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/nextmv-io/nextroute go 1.21 require ( - github.com/nextmv-io/sdk v1.8.1 + github.com/nextmv-io/sdk v1.8.2 gonum.org/v1/gonum v0.14.0 ) diff --git a/go.sum b/go.sum index 029c8a1..ea77de9 100644 --- a/go.sum +++ b/go.sum @@ -301,8 +301,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nextmv-io/sdk v1.8.1 h1:CYhhDtd4ZeFYfHXSinVQpvH4mIPJHOqtQGUaSwBfpp8= -github.com/nextmv-io/sdk v1.8.1/go.mod h1:Y48XLPcIOOxRgO86ICNpqGrH2N5+dd1TDNvef/FD2Kc= +github.com/nextmv-io/sdk v1.8.2 h1:9jqtchlgrt7aDzRCRRBr9AM192tRBaN82hUIxpOV/Xg= +github.com/nextmv-io/sdk v1.8.2/go.mod h1:Y48XLPcIOOxRgO86ICNpqGrH2N5+dd1TDNvef/FD2Kc= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= diff --git a/requirements.txt b/requirements.txt index e9039c2..b5a18d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ pydantic>=2.5.2 ruff>=0.1.7 twine>=4.0.2 hatch>=1.13.0 -nextmv>=0.13.1 +nextmv>=0.14.1 diff --git a/src/tests/solve_golden/main.py b/src/tests/solve_golden/main.py index 8e64836..44b0c12 100644 --- a/src/tests/solve_golden/main.py +++ b/src/tests/solve_golden/main.py @@ -1,8 +1,6 @@ # This script is copied to the `src` root so that the `nextroute` import is # resolved. It is fed an input via stdin and is meant to write the output to # stdout. -from typing import Any, Dict - import nextmv import nextroute @@ -16,8 +14,8 @@ def main() -> None: nextmv.Parameter("output", str, "", "Path to output file. Default is stdout.", False), ] - nextroute_options = nextroute.Options() - for name, default_value in nextroute_options.to_dict().items(): + default_options = nextroute.Options() + for name, default_value in default_options.to_dict().items(): parameters.append(nextmv.Parameter(name.lower(), type(default_value), default_value, name, False)) options = nextmv.Options(*parameters) @@ -28,18 +26,24 @@ def main() -> None: nextmv.log(f" - stops: {len(input.data.get('stops', []))}") nextmv.log(f" - vehicles: {len(input.data.get('vehicles', []))}") - output = solve(input, options) + model = DecisionModel() + output = model.solve(input) nextmv.write_local(output, path=options.output) -def solve(input: nextmv.Input, options: nextmv.Options) -> Dict[str, Any]: - """Solves the given problem and returns the solution.""" +class DecisionModel(nextmv.Model): + def solve(self, input: nextmv.Input) -> nextmv.Output: + """Solves the given problem and returns the solution.""" - nextroute_input = nextroute.schema.Input.from_dict(input.data) - nextroute_options = nextroute.Options.extract_from_dict(options.to_dict()) - nextroute_output = nextroute.solve(nextroute_input, nextroute_options) + nextroute_input = nextroute.schema.Input.from_dict(input.data) + nextroute_options = nextroute.Options.extract_from_dict(input.options.to_dict()) + nextroute_output = nextroute.solve(nextroute_input, nextroute_options) - return nextroute_output.to_dict() + return nextmv.Output( + options=input.options, + solution=nextroute_output.solutions[0].to_dict(), + statistics=nextroute_output.statistics.to_dict(), + ) if __name__ == "__main__": diff --git a/src/tests/solve_golden/main_test.go b/src/tests/solve_golden/main_test.go index 4ffec88..35c0f49 100644 --- a/src/tests/solve_golden/main_test.go +++ b/src/tests/solve_golden/main_test.go @@ -73,8 +73,8 @@ func TestPythonSolveGolden(t *testing.T) { {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, {Key: "$.statistics.run.duration", Replacement: golden.StableFloat}, {Key: "$.statistics.result.value", Replacement: golden.StableFloat}, - {Key: "$.options.nextmv.output", Replacement: "output.json"}, - {Key: "$.options.nextmv.input", Replacement: "input.json"}, + {Key: "$.options.output", Replacement: "output.json"}, + {Key: "$.options.input", Replacement: "input.json"}, {Key: "$.statistics.result.custom.max_travel_duration", Replacement: golden.StableFloat}, {Key: "$.statistics.result.custom.min_travel_duration", Replacement: golden.StableFloat}, {Key: "$.statistics.result.custom.max_duration", Replacement: golden.StableFloat}, @@ -83,6 +83,7 @@ func TestPythonSolveGolden(t *testing.T) { Thresholds: golden.Tresholds{ Float: 0.01, }, + GoldenExtension: ".python.golden", ExecutionConfig: &golden.ExecutionConfig{ Command: "python3", Args: []string{pythonFileDestination}, diff --git a/tests/check/input.json.golden b/tests/check/input.json.golden index bca1375..b6ad083 100644 --- a/tests/check/input.json.golden +++ b/tests/check/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/custom_constraint/input.json.golden b/tests/custom_constraint/input.json.golden index a7a4576..5e07ae4 100644 --- a/tests/custom_constraint/input.json.golden +++ b/tests/custom_constraint/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/custom_matrices/input.json.golden b/tests/custom_matrices/input.json.golden index 3812299..a61b66f 100644 --- a/tests/custom_matrices/input.json.golden +++ b/tests/custom_matrices/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/custom_objective/input.json.golden b/tests/custom_objective/input.json.golden index d7902c3..82733d0 100644 --- a/tests/custom_objective/input.json.golden +++ b/tests/custom_objective/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/custom_operators/input.json.golden b/tests/custom_operators/input.json.golden index 588fa45..6235077 100644 --- a/tests/custom_operators/input.json.golden +++ b/tests/custom_operators/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/main_test.go b/tests/golden/main_test.go index 17a925d..7a703c3 100644 --- a/tests/golden/main_test.go +++ b/tests/golden/main_test.go @@ -34,6 +34,7 @@ func TestGolden(t *testing.T) { // for deterministic tests "-solve.startsolutions", "1", }, + GoldenExtension: ".go.golden", TransientFields: []golden.TransientField{ {Key: "$.version.sdk", Replacement: golden.StableVersion}, {Key: "$.statistics.result.duration", Replacement: golden.StableFloat}, diff --git a/tests/golden/testdata/activation_penalty.json.golden b/tests/golden/testdata/activation_penalty.json.go.golden similarity index 99% rename from tests/golden/testdata/activation_penalty.json.golden rename to tests/golden/testdata/activation_penalty.json.go.golden index 83eb552..5a5e183 100644 --- a/tests/golden/testdata/activation_penalty.json.golden +++ b/tests/golden/testdata/activation_penalty.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/activation_penalty.json.python.golden b/tests/golden/testdata/activation_penalty.json.python.golden new file mode 100644 index 0000000..fbe8fab --- /dev/null +++ b/tests/golden/testdata/activation_penalty.json.python.golden @@ -0,0 +1,208 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicle_activation_penalty + 1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "factor": 1, + "name": "vehicle_activation_penalty", + "value": 0 + }, + { + "base": 909.0466359667602, + "factor": 1, + "name": "vehicles_duration", + "value": 909.0466359667602 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 909.0466359667602 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 14897, + "cumulative_travel_duration": 745, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 18177, + "cumulative_travel_duration": 909, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/alternates.json.golden b/tests/golden/testdata/alternates.json.go.golden similarity index 99% rename from tests/golden/testdata/alternates.json.golden rename to tests/golden/testdata/alternates.json.go.golden index 6a4b3d8..6a7b1b6 100644 --- a/tests/golden/testdata/alternates.json.golden +++ b/tests/golden/testdata/alternates.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/alternates.json.python.golden b/tests/golden/testdata/alternates.json.python.golden new file mode 100644 index 0000000..48a6658 --- /dev/null +++ b/tests/golden/testdata/alternates.json.python.golden @@ -0,0 +1,247 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 925.145499687516, + "factor": 1, + "name": "vehicles_duration", + "value": 925.145499687516 + }, + { + "base": 4000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 4000000 + } + ], + "value": 4000925.1454996876 + }, + "unplanned": [], + "vehicles": [ + { + "alternate_stops": [ + "Inari" + ], + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 14897, + "cumulative_travel_duration": 745, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 18263, + "cumulative_travel_duration": 913, + "stop": { + "id": "Inari", + "location": { + "lat": 34.9686029, + "lon": 135.7666538 + } + }, + "travel_distance": 3366, + "travel_duration": 168 + } + ], + "route_duration": 913, + "route_travel_distance": 18263, + "route_travel_duration": 913 + }, + { + "alternate_stops": [ + "Inafuku" + ], + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 236, + "cumulative_travel_duration": 11, + "stop": { + "id": "Inafuku", + "location": { + "lat": 34.9671591, + "lon": 135.770104 + } + }, + "travel_distance": 236, + "travel_duration": 11 + } + ], + "route_duration": 11, + "route_travel_distance": 236, + "route_travel_duration": 11 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/basic.json.golden b/tests/golden/testdata/basic.json.go.golden similarity index 99% rename from tests/golden/testdata/basic.json.golden rename to tests/golden/testdata/basic.json.go.golden index 0f03925..e38ddd1 100644 --- a/tests/golden/testdata/basic.json.golden +++ b/tests/golden/testdata/basic.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/basic.json.python.golden b/tests/golden/testdata/basic.json.python.golden new file mode 100644 index 0000000..96e8252 --- /dev/null +++ b/tests/golden/testdata/basic.json.python.golden @@ -0,0 +1,197 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 909.0466359667602, + "factor": 1, + "name": "vehicles_duration", + "value": 909.0466359667602 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 909.0466359667602 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 14897, + "cumulative_travel_duration": 745, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 18177, + "cumulative_travel_duration": 909, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/capacity.json.golden b/tests/golden/testdata/capacity.json.go.golden similarity index 99% rename from tests/golden/testdata/capacity.json.golden rename to tests/golden/testdata/capacity.json.go.golden index 1d26363..62e9682 100644 --- a/tests/golden/testdata/capacity.json.golden +++ b/tests/golden/testdata/capacity.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/capacity.json.python.golden b/tests/golden/testdata/capacity.json.python.golden new file mode 100644 index 0000000..f6a9639 --- /dev/null +++ b/tests/golden/testdata/capacity.json.python.golden @@ -0,0 +1,214 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1155.4805543604316, + "factor": 1, + "name": "vehicles_duration", + "value": 1155.4805543604316 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1155.4805543604316 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 7274, + "cumulative_travel_duration": 363, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3994, + "travel_duration": 199 + } + ], + "route_duration": 363, + "route_travel_distance": 7274, + "route_travel_duration": 363 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3410, + "cumulative_travel_duration": 170, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 6249, + "cumulative_travel_duration": 312, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 15832, + "cumulative_travel_duration": 791, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 9583, + "travel_duration": 479 + } + ], + "route_duration": 791, + "route_travel_distance": 15832, + "route_travel_duration": 791 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 4, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/compatibility_attributes.json.golden b/tests/golden/testdata/compatibility_attributes.json.go.golden similarity index 99% rename from tests/golden/testdata/compatibility_attributes.json.golden rename to tests/golden/testdata/compatibility_attributes.json.go.golden index 51ff163..990dc8a 100644 --- a/tests/golden/testdata/compatibility_attributes.json.golden +++ b/tests/golden/testdata/compatibility_attributes.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/compatibility_attributes.json.python.golden b/tests/golden/testdata/compatibility_attributes.json.python.golden new file mode 100644 index 0000000..f3bcedc --- /dev/null +++ b/tests/golden/testdata/compatibility_attributes.json.python.golden @@ -0,0 +1,234 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 368.0821280755173, + "factor": 1, + "name": "vehicles_duration", + "value": 368.0821280755173 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 368.0821280755173 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v3", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v3-start", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1201, + "cumulative_travel_duration": 60, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 4031, + "cumulative_travel_duration": 201, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 7360, + "cumulative_travel_duration": 368, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + } + ], + "route_duration": 368, + "route_travel_distance": 7360, + "route_travel_duration": 368 + }, + { + "id": "v4", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 4, + "max_duration": 0.123, + "max_stops_in_vehicle": 4, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/complex_precedence.json.golden b/tests/golden/testdata/complex_precedence.json.go.golden similarity index 99% rename from tests/golden/testdata/complex_precedence.json.golden rename to tests/golden/testdata/complex_precedence.json.go.golden index f3708e6..a48d477 100644 --- a/tests/golden/testdata/complex_precedence.json.golden +++ b/tests/golden/testdata/complex_precedence.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/complex_precedence.json.python.golden b/tests/golden/testdata/complex_precedence.json.python.golden new file mode 100644 index 0000000..eaeb883 --- /dev/null +++ b/tests/golden/testdata/complex_precedence.json.python.golden @@ -0,0 +1,443 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty + 1 * late_arrival_penalty", + "objectives": [ + { + "base": 6192.244272708893, + "factor": 1, + "name": "vehicles_duration", + "value": 6192.244272708893 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + }, + { + "factor": 1, + "name": "early_arrival_penalty", + "value": 0 + }, + { + "base": 3327092.8730487823, + "factor": 1, + "name": "late_arrival_penalty", + "value": 3327092.8730487823 + } + ], + "value": 3333285.1173214912 + }, + "unplanned": [], + "vehicles": [ + { + "id": "f58d08e1-c76e-4069-84f2-5bf1f91cb5af", + "route": [ + { + "arrival_time": "2023-08-14T04:50:58Z", + "cumulative_travel_duration": 0, + "end_time": "2023-08-14T04:50:58Z", + "start_time": "2023-08-14T04:50:58Z", + "stop": { + "id": "f58d08e1-c76e-4069-84f2-5bf1f91cb5af-start", + "location": { + "lat": 36.54117456741561, + "lon": 26.339803225684133 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-08-14T04:50:58Z", + "cumulative_travel_duration": 0, + "end_time": "2023-08-14T04:50:58Z", + "late_arrival_duration": 357, + "start_time": "2023-08-14T04:50:58Z", + "stop": { + "id": "f58d08e1-c76e-4069-84f2-5bf1f91cb5af-start-pickup", + "location": { + "lat": 36.54117456741561, + "lon": 26.339803225684133 + } + }, + "target_arrival_time": "2023-08-14T04:45:00.591503Z", + "travel_duration": 0 + }, + { + "arrival_time": "2023-08-14T04:55:56Z", + "cumulative_travel_distance": 1194, + "cumulative_travel_duration": 298, + "duration": 90, + "end_time": "2023-08-14T04:57:26Z", + "late_arrival_duration": 766, + "start_time": "2023-08-14T04:55:56Z", + "stop": { + "id": "67259CDYWF-DROP_OFF", + "location": { + "lat": 36.545800386888374, + "lon": 26.351867507809075 + } + }, + "target_arrival_time": "2023-08-14T04:43:09.749692Z", + "travel_distance": 1194, + "travel_duration": 298 + }, + { + "arrival_time": "2023-08-14T05:06:52Z", + "cumulative_travel_distance": 3459, + "cumulative_travel_duration": 864, + "duration": 180, + "end_time": "2023-08-14T05:09:52Z", + "late_arrival_duration": 961, + "start_time": "2023-08-14T05:06:52Z", + "stop": { + "id": "6725EE3X1S-PICK_UP", + "location": { + "lat": 36.566128234355254, + "lon": 26.35361626659969 + } + }, + "target_arrival_time": "2023-08-14T04:50:51Z", + "travel_distance": 2265, + "travel_duration": 566 + }, + { + "arrival_time": "2023-08-14T05:21:22Z", + "cumulative_travel_distance": 6215, + "cumulative_travel_duration": 1554, + "duration": 90, + "end_time": "2023-08-14T05:22:52Z", + "late_arrival_duration": 2530, + "start_time": "2023-08-14T05:21:22Z", + "stop": { + "id": "6725C6378Q-PICK_UP", + "location": { + "lat": 36.57730697190387, + "lon": 26.381170639727394 + } + }, + "target_arrival_time": "2023-08-14T04:39:11.264097Z", + "travel_distance": 2756, + "travel_duration": 689 + }, + { + "arrival_time": "2023-08-14T05:24:13Z", + "cumulative_travel_distance": 6540, + "cumulative_travel_duration": 1635, + "duration": 90, + "end_time": "2023-08-14T05:25:43Z", + "late_arrival_duration": 3950, + "start_time": "2023-08-14T05:24:13Z", + "stop": { + "id": "6725782PZY-PICK_UP", + "location": { + "lat": 36.57622921586711, + "lon": 26.38456105888973 + } + }, + "target_arrival_time": "2023-08-14T04:18:22.347629Z", + "travel_distance": 325, + "travel_duration": 81 + }, + { + "arrival_time": "2023-08-14T05:42:14Z", + "cumulative_travel_distance": 10503, + "cumulative_travel_duration": 2626, + "duration": 180, + "end_time": "2023-08-14T05:45:14Z", + "late_arrival_duration": 2183, + "start_time": "2023-08-14T05:42:14Z", + "stop": { + "id": "6725EE3X1S-DROP_OFF", + "location": { + "lat": 36.55033217318192, + "lon": 26.354067929305888 + } + }, + "target_arrival_time": "2023-08-14T05:05:51Z", + "travel_distance": 3963, + "travel_duration": 990 + }, + { + "arrival_time": "2023-08-14T05:47:29Z", + "cumulative_travel_distance": 11043, + "cumulative_travel_duration": 2761, + "duration": 90, + "end_time": "2023-08-14T05:48:59Z", + "late_arrival_duration": 3197, + "start_time": "2023-08-14T05:47:29Z", + "stop": { + "id": "6725C6378Q-DROP_OFF", + "location": { + "lat": 36.545800386888374, + "lon": 26.351867507809075 + } + }, + "target_arrival_time": "2023-08-14T04:54:11.264097Z", + "travel_distance": 540, + "travel_duration": 135 + }, + { + "arrival_time": "2023-08-14T05:48:59Z", + "cumulative_travel_distance": 11043, + "cumulative_travel_duration": 2761, + "duration": 90, + "end_time": "2023-08-14T05:50:29Z", + "late_arrival_duration": 4536, + "start_time": "2023-08-14T05:48:59Z", + "stop": { + "id": "6725782PZY-DROP_OFF", + "location": { + "lat": 36.545800386888374, + "lon": 26.351867507809075 + } + }, + "target_arrival_time": "2023-08-14T04:33:22.347629Z", + "travel_duration": 0 + } + ], + "route_duration": 3571, + "route_stops_duration": 810, + "route_travel_distance": 11043, + "route_travel_duration": 2761 + }, + { + "id": "b5fdf5fa-5022-46de-84e1-1bdf360c5e61", + "route": [ + { + "arrival_time": "2023-08-14T04:49:19Z", + "cumulative_travel_duration": 0, + "end_time": "2023-08-14T04:49:19Z", + "start_time": "2023-08-14T04:49:19Z", + "stop": { + "id": "b5fdf5fa-5022-46de-84e1-1bdf360c5e61-start", + "location": { + "lat": 36.579638979635, + "lon": 26.36896132086359 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-08-14T04:49:19Z", + "cumulative_travel_duration": 0, + "end_time": "2023-08-14T04:49:19Z", + "late_arrival_duration": 258, + "start_time": "2023-08-14T04:49:19Z", + "stop": { + "id": "b5fdf5fa-5022-46de-84e1-1bdf360c5e61-start-pickup", + "location": { + "lat": 36.579638979635, + "lon": 26.36896132086359 + } + }, + "target_arrival_time": "2023-08-14T04:45:00.598768Z", + "travel_duration": 0 + }, + { + "arrival_time": "2023-08-14T04:53:59Z", + "cumulative_travel_distance": 1120, + "cumulative_travel_duration": 280, + "duration": 90, + "end_time": "2023-08-14T04:55:29Z", + "late_arrival_duration": 833, + "start_time": "2023-08-14T04:53:59Z", + "stop": { + "id": "6725C99WQR-PICK_UP", + "location": { + "lat": 36.57730697190387, + "lon": 26.381170639727394 + } + }, + "target_arrival_time": "2023-08-14T04:40:05.194858Z", + "travel_distance": 1120, + "travel_duration": 280 + }, + { + "arrival_time": "2023-08-14T05:12:29Z", + "cumulative_travel_distance": 5201, + "cumulative_travel_duration": 1300, + "duration": 270, + "end_time": "2023-08-14T05:16:59Z", + "late_arrival_duration": 1596, + "start_time": "2023-08-14T05:12:29Z", + "stop": { + "id": "67252B6AU7-DROP_OFF", + "location": { + "lat": 36.5469121396049, + "lon": 26.355559253425483 + } + }, + "target_arrival_time": "2023-08-14T04:45:53Z", + "travel_distance": 4081, + "travel_duration": 1020 + }, + { + "arrival_time": "2023-08-14T05:18:14Z", + "cumulative_travel_distance": 5501, + "cumulative_travel_duration": 1375, + "duration": 90, + "end_time": "2023-08-14T05:19:44Z", + "late_arrival_duration": 1430, + "start_time": "2023-08-14T05:18:14Z", + "stop": { + "id": "6725FF3BY5-PICK_UP", + "location": { + "lat": 36.54955608987272, + "lon": 26.354841051021616 + } + }, + "target_arrival_time": "2023-08-14T04:54:23.965466Z", + "travel_distance": 300, + "travel_duration": 75 + }, + { + "arrival_time": "2023-08-14T05:21:17Z", + "cumulative_travel_distance": 5873, + "cumulative_travel_duration": 1468, + "duration": 90, + "end_time": "2023-08-14T05:22:47Z", + "late_arrival_duration": 1323, + "start_time": "2023-08-14T05:21:17Z", + "stop": { + "id": "67261158NH-PICK_UP", + "location": { + "lat": 36.54853950288169, + "lon": 26.350871714738275 + } + }, + "target_arrival_time": "2023-08-14T04:59:13.978563Z", + "travel_distance": 372, + "travel_duration": 93 + }, + { + "arrival_time": "2023-08-14T05:24:07Z", + "cumulative_travel_distance": 6190, + "cumulative_travel_duration": 1548, + "duration": 90, + "end_time": "2023-08-14T05:25:37Z", + "late_arrival_duration": 1741, + "start_time": "2023-08-14T05:24:07Z", + "stop": { + "id": "6725C99WQR-DROP_OFF", + "location": { + "lat": 36.545800386888374, + "lon": 26.351867507809075 + } + }, + "target_arrival_time": "2023-08-14T04:55:05.194858Z", + "travel_distance": 317, + "travel_duration": 79 + }, + { + "arrival_time": "2023-08-14T05:26:24Z", + "cumulative_travel_distance": 6379, + "cumulative_travel_duration": 1595, + "duration": 90, + "end_time": "2023-08-14T05:27:54Z", + "late_arrival_duration": 1020, + "start_time": "2023-08-14T05:26:24Z", + "stop": { + "id": "6725FF3BY5-DROP_OFF", + "location": { + "lat": 36.54444696712649, + "lon": 26.350574660089876 + } + }, + "target_arrival_time": "2023-08-14T05:09:23.965466Z", + "travel_distance": 189, + "travel_duration": 47 + }, + { + "arrival_time": "2023-08-14T05:31:29Z", + "cumulative_travel_distance": 7239, + "cumulative_travel_duration": 1810, + "duration": 90, + "end_time": "2023-08-14T05:32:59Z", + "late_arrival_duration": 1035, + "start_time": "2023-08-14T05:31:29Z", + "stop": { + "id": "67261158NH-DROP_OFF", + "location": { + "lat": 36.54171597174676, + "lon": 26.341562225094144 + } + }, + "target_arrival_time": "2023-08-14T05:14:13.978563Z", + "travel_distance": 860, + "travel_duration": 215 + } + ], + "route_duration": 2620, + "route_stops_duration": 810, + "route_travel_distance": 7239, + "route_travel_duration": 1810 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 8, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 8, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/custom_data.json.golden b/tests/golden/testdata/custom_data.json.go.golden similarity index 99% rename from tests/golden/testdata/custom_data.json.golden rename to tests/golden/testdata/custom_data.json.go.golden index ff8c5d3..2efe46d 100644 --- a/tests/golden/testdata/custom_data.json.golden +++ b/tests/golden/testdata/custom_data.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/custom_data.json.python.golden b/tests/golden/testdata/custom_data.json.python.golden new file mode 100644 index 0000000..23c69a1 --- /dev/null +++ b/tests/golden/testdata/custom_data.json.python.golden @@ -0,0 +1,225 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 909.0466359667602, + "factor": 1, + "name": "vehicles_duration", + "value": 909.0466359667602 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 909.0466359667602 + }, + "unplanned": [], + "vehicles": [ + { + "custom_data": { + "dolor": "sit amet", + "lorem": "ipsum" + }, + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "custom_data": { + "foo": "bar", + "roh": false + }, + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "stop": { + "custom_data": { + "baz": 2, + "foo": "bar" + }, + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "stop": { + "custom_data": { + "baz": 3, + "foo": "bar" + }, + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "custom_data": { + "foo": "bar", + "roh": true + }, + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 14897, + "cumulative_travel_duration": 745, + "stop": { + "custom_data": { + "baz": 1, + "foo": "bar" + }, + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 18177, + "cumulative_travel_duration": 909, + "stop": { + "custom_data": { + "baz": 0, + "foo": "bar" + }, + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/defaults.json.golden b/tests/golden/testdata/defaults.json.go.golden similarity index 99% rename from tests/golden/testdata/defaults.json.golden rename to tests/golden/testdata/defaults.json.go.golden index 8abfc83..50968d8 100644 --- a/tests/golden/testdata/defaults.json.golden +++ b/tests/golden/testdata/defaults.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/defaults.json.python.golden b/tests/golden/testdata/defaults.json.python.golden new file mode 100644 index 0000000..39c2397 --- /dev/null +++ b/tests/golden/testdata/defaults.json.python.golden @@ -0,0 +1,389 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty + 1 * late_arrival_penalty", + "objectives": [ + { + "base": 6351.082469701767, + "factor": 1, + "name": "vehicles_duration", + "value": 6351.082469701767 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + }, + { + "base": 4217.552098274231, + "factor": 1, + "name": "early_arrival_penalty", + "value": 4217.552098274231 + }, + { + "base": 681.325391292572, + "factor": 1, + "name": "late_arrival_penalty", + "value": 681.325391292572 + } + ], + "value": 11249.95995926857 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:07:16Z", + "cumulative_travel_distance": 6553, + "cumulative_travel_duration": 436, + "duration": 300, + "early_arrival_duration": 764, + "end_time": "2023-01-01T12:12:16Z", + "start_time": "2023-01-01T12:07:16Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 6553, + "travel_duration": 436 + }, + { + "arrival_time": "2023-01-01T12:19:33Z", + "cumulative_travel_distance": 13106, + "cumulative_travel_duration": 873, + "duration": 300, + "early_arrival_duration": 27, + "end_time": "2023-01-01T12:24:33Z", + "start_time": "2023-01-01T12:19:33Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 6553, + "travel_duration": 436 + }, + { + "arrival_time": "2023-01-01T12:24:33Z", + "cumulative_travel_distance": 13106, + "cumulative_travel_duration": 873, + "end_time": "2023-01-01T12:24:33Z", + "start_time": "2023-01-01T12:24:33Z", + "stop": { + "id": "v1-end", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 1473, + "route_stops_duration": 600, + "route_travel_distance": 13106, + "route_travel_duration": 873 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:00Z", + "cumulative_travel_distance": 9000, + "cumulative_travel_duration": 600, + "duration": 300, + "early_arrival_duration": 600, + "end_time": "2023-01-01T12:15:00Z", + "start_time": "2023-01-01T12:10:00Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 9000, + "travel_duration": 600 + }, + { + "arrival_time": "2023-01-01T12:22:56Z", + "cumulative_travel_distance": 16143, + "cumulative_travel_duration": 1076, + "duration": 300, + "end_time": "2023-01-01T12:27:56Z", + "late_arrival_duration": 176, + "start_time": "2023-01-01T12:22:56Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 7143, + "travel_duration": 476 + }, + { + "arrival_time": "2023-01-01T12:31:34Z", + "cumulative_travel_distance": 19423, + "cumulative_travel_duration": 1294, + "end_time": "2023-01-01T12:31:34Z", + "start_time": "2023-01-01T12:31:34Z", + "stop": { + "id": "v2-end", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 218 + } + ], + "route_duration": 1894, + "route_stops_duration": 600, + "route_travel_distance": 19423, + "route_travel_duration": 1294 + }, + { + "id": "v3", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v3-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:04:22Z", + "cumulative_travel_distance": 3935, + "cumulative_travel_duration": 262, + "duration": 300, + "early_arrival_duration": 938, + "end_time": "2023-01-01T12:09:22Z", + "start_time": "2023-01-01T12:04:22Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 3935, + "travel_duration": 262 + }, + { + "arrival_time": "2023-01-01T12:13:44Z", + "cumulative_travel_distance": 7870, + "cumulative_travel_duration": 524, + "end_time": "2023-01-01T12:13:44Z", + "start_time": "2023-01-01T12:13:44Z", + "stop": { + "id": "v3-end", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3935, + "travel_duration": 262 + } + ], + "route_duration": 824, + "route_stops_duration": 300, + "route_travel_distance": 7870, + "route_travel_duration": 524 + }, + { + "id": "v4", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v4-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:11:55Z", + "cumulative_travel_distance": 10729, + "cumulative_travel_duration": 715, + "duration": 300, + "early_arrival_duration": 485, + "end_time": "2023-01-01T12:16:55Z", + "start_time": "2023-01-01T12:11:55Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 10729, + "travel_duration": 715 + }, + { + "arrival_time": "2023-01-01T12:24:37Z", + "cumulative_travel_distance": 17669, + "cumulative_travel_duration": 1177, + "duration": 300, + "end_time": "2023-01-01T12:29:37Z", + "late_arrival_duration": 277, + "start_time": "2023-01-01T12:24:37Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 6940, + "travel_duration": 462 + }, + { + "arrival_time": "2023-01-01T12:35:57Z", + "cumulative_travel_distance": 23363, + "cumulative_travel_duration": 1557, + "end_time": "2023-01-01T12:35:57Z", + "start_time": "2023-01-01T12:35:57Z", + "stop": { + "id": "v4-end", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 5694, + "travel_duration": 379 + } + ], + "route_duration": 2157, + "route_stops_duration": 600, + "route_travel_distance": 23363, + "route_travel_duration": 1557 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 4, + "max_duration": 0.123, + "max_stops_in_vehicle": 2, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/direct_precedence.json.golden b/tests/golden/testdata/direct_precedence.json.go.golden similarity index 99% rename from tests/golden/testdata/direct_precedence.json.golden rename to tests/golden/testdata/direct_precedence.json.go.golden index 9458c1c..e4710d4 100644 --- a/tests/golden/testdata/direct_precedence.json.golden +++ b/tests/golden/testdata/direct_precedence.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/direct_precedence.json.python.golden b/tests/golden/testdata/direct_precedence.json.python.golden new file mode 100644 index 0000000..b6c5ce2 --- /dev/null +++ b/tests/golden/testdata/direct_precedence.json.python.golden @@ -0,0 +1,186 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1319.8793982515122, + "factor": 1, + "name": "vehicles_duration", + "value": 1319.8793982515122 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1319.8793982515122 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 7273, + "cumulative_travel_duration": 363, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3993, + "travel_duration": 199 + }, + { + "cumulative_travel_distance": 10683, + "cumulative_travel_duration": 534, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 16624, + "cumulative_travel_duration": 831, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 5941, + "travel_duration": 297 + }, + { + "cumulative_travel_distance": 19454, + "cumulative_travel_duration": 972, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 26394, + "cumulative_travel_duration": 1319, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 1319, + "route_travel_distance": 26394, + "route_travel_duration": 1319 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/direct_precedence_linked.json.golden b/tests/golden/testdata/direct_precedence_linked.json.go.golden similarity index 99% rename from tests/golden/testdata/direct_precedence_linked.json.golden rename to tests/golden/testdata/direct_precedence_linked.json.go.golden index 72301e4..3747766 100644 --- a/tests/golden/testdata/direct_precedence_linked.json.golden +++ b/tests/golden/testdata/direct_precedence_linked.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/direct_precedence_linked.json.python.golden b/tests/golden/testdata/direct_precedence_linked.json.python.golden new file mode 100644 index 0000000..0cd8e1e --- /dev/null +++ b/tests/golden/testdata/direct_precedence_linked.json.python.golden @@ -0,0 +1,186 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1321.4235337700516, + "factor": 1, + "name": "vehicles_duration", + "value": 1321.4235337700516 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1321.4235337700516 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 7273, + "cumulative_travel_duration": 363, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3993, + "travel_duration": 199 + }, + { + "cumulative_travel_distance": 10683, + "cumulative_travel_duration": 534, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 14012, + "cumulative_travel_duration": 700, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 16842, + "cumulative_travel_duration": 842, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 26425, + "cumulative_travel_duration": 1321, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 9583, + "travel_duration": 479 + } + ], + "route_duration": 1321, + "route_travel_distance": 26425, + "route_travel_duration": 1321 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/distance_matrix.json.golden b/tests/golden/testdata/distance_matrix.json.go.golden similarity index 99% rename from tests/golden/testdata/distance_matrix.json.golden rename to tests/golden/testdata/distance_matrix.json.go.golden index d531fb5..02f975b 100644 --- a/tests/golden/testdata/distance_matrix.json.golden +++ b/tests/golden/testdata/distance_matrix.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/distance_matrix.json.python.golden b/tests/golden/testdata/distance_matrix.json.python.golden new file mode 100644 index 0000000..d2fd687 --- /dev/null +++ b/tests/golden/testdata/distance_matrix.json.python.golden @@ -0,0 +1,139 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 335, + "factor": 1, + "name": "vehicles_duration", + "value": 335 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 335 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 6700, + "cumulative_travel_duration": 335, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 6700, + "travel_duration": 335 + } + ], + "route_duration": 335, + "route_travel_distance": 6700, + "route_travel_duration": 335 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 2, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_groups.json.golden b/tests/golden/testdata/duration_groups.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_groups.json.golden rename to tests/golden/testdata/duration_groups.json.go.golden index d11a3fc..269a52d 100644 --- a/tests/golden/testdata/duration_groups.json.golden +++ b/tests/golden/testdata/duration_groups.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_groups.json.python.golden b/tests/golden/testdata/duration_groups.json.python.golden new file mode 100644 index 0000000..ada7619 --- /dev/null +++ b/tests/golden/testdata/duration_groups.json.python.golden @@ -0,0 +1,201 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1727.601181827492, + "factor": 1, + "name": "vehicles_duration", + "value": 1727.601181827492 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1727.601181827492 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "duration": 100, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "duration": 200, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 10422, + "cumulative_travel_duration": 521, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5941, + "travel_duration": 297 + }, + { + "cumulative_travel_distance": 13832, + "cumulative_travel_duration": 691, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 15608, + "cumulative_travel_duration": 780, + "duration": 300, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 22548, + "cumulative_travel_duration": 1127, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 1727, + "route_stops_duration": 600, + "route_travel_distance": 22548, + "route_travel_duration": 1127 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden rename to tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden index 7c93949..f952ea9 100644 --- a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden +++ b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.python.golden b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.python.golden new file mode 100644 index 0000000..fa54b2c --- /dev/null +++ b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.python.golden @@ -0,0 +1,201 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 2327.601181827492, + "factor": 1, + "name": "vehicles_duration", + "value": 2327.601181827492 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 2327.601181827492 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "duration": 200, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "duration": 400, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 10422, + "cumulative_travel_duration": 521, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5941, + "travel_duration": 297 + }, + { + "cumulative_travel_distance": 13832, + "cumulative_travel_duration": 691, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 15608, + "cumulative_travel_duration": 780, + "duration": 600, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 22548, + "cumulative_travel_duration": 1127, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 2327, + "route_stops_duration": 1200, + "route_travel_distance": 22548, + "route_travel_duration": 1127 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_matrix.json.golden b/tests/golden/testdata/duration_matrix.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_matrix.json.golden rename to tests/golden/testdata/duration_matrix.json.go.golden index f1d354c..2f66fac 100644 --- a/tests/golden/testdata/duration_matrix.json.golden +++ b/tests/golden/testdata/duration_matrix.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_matrix.json.python.golden b/tests/golden/testdata/duration_matrix.json.python.golden new file mode 100644 index 0000000..46f221e --- /dev/null +++ b/tests/golden/testdata/duration_matrix.json.python.golden @@ -0,0 +1,134 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1380, + "factor": 1, + "name": "vehicles_duration", + "value": 1380 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1380 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3994, + "cumulative_travel_duration": 660, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3994, + "travel_duration": 660 + }, + { + "cumulative_travel_distance": 7274, + "cumulative_travel_duration": 1380, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 720 + } + ], + "route_duration": 1380, + "route_travel_distance": 7274, + "route_travel_duration": 1380 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent0.json.golden b/tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_matrix_time_dependent0.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden index 169b3f6..c3a5c60 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent0.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_matrix_time_dependent0.json.python.golden b/tests/golden/testdata/duration_matrix_time_dependent0.json.python.golden new file mode 100644 index 0000000..1a49122 --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent0.json.python.golden @@ -0,0 +1,143 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1380, + "factor": 1, + "name": "vehicles_duration", + "value": 1380 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1380 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:11:00Z", + "cumulative_travel_distance": 3994, + "cumulative_travel_duration": 660, + "end_time": "2023-01-01T12:11:00Z", + "start_time": "2023-01-01T12:11:00Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3994, + "travel_duration": 660 + }, + { + "arrival_time": "2023-01-01T12:23:00Z", + "cumulative_travel_distance": 7274, + "cumulative_travel_duration": 1380, + "end_time": "2023-01-01T12:23:00Z", + "start_time": "2023-01-01T12:23:00Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 720 + } + ], + "route_duration": 1380, + "route_travel_distance": 7274, + "route_travel_duration": 1380 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent1.json.golden b/tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_matrix_time_dependent1.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden index f21a51d..4539daf 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent1.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_matrix_time_dependent1.json.python.golden b/tests/golden/testdata/duration_matrix_time_dependent1.json.python.golden new file mode 100644 index 0000000..a9e2628 --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent1.json.python.golden @@ -0,0 +1,143 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1498.8171701431274, + "factor": 1, + "name": "vehicles_duration", + "value": 1498.8171701431274 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1498.8171701431274 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:11:45Z", + "cumulative_travel_distance": 3994, + "cumulative_travel_duration": 705, + "end_time": "2023-01-01T12:11:45Z", + "start_time": "2023-01-01T12:11:45Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3994, + "travel_duration": 705 + }, + { + "arrival_time": "2023-01-01T12:24:58Z", + "cumulative_travel_distance": 7274, + "cumulative_travel_duration": 1498, + "end_time": "2023-01-01T12:24:58Z", + "start_time": "2023-01-01T12:24:58Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 793 + } + ], + "route_duration": 1498, + "route_travel_distance": 7274, + "route_travel_duration": 1498 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent2.json.golden b/tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_matrix_time_dependent2.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden index 2474759..d6ecc4c 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent2.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_matrix_time_dependent2.json.python.golden b/tests/golden/testdata/duration_matrix_time_dependent2.json.python.golden new file mode 100644 index 0000000..f936e14 --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent2.json.python.golden @@ -0,0 +1,143 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1950, + "factor": 1, + "name": "vehicles_duration", + "value": 1950 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1950 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:20:30Z", + "cumulative_travel_distance": 3994, + "cumulative_travel_duration": 1230, + "end_time": "2023-01-01T12:20:30Z", + "start_time": "2023-01-01T12:20:30Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3994, + "travel_duration": 1230 + }, + { + "arrival_time": "2023-01-01T12:32:30Z", + "cumulative_travel_distance": 7274, + "cumulative_travel_duration": 1950, + "end_time": "2023-01-01T12:32:30Z", + "start_time": "2023-01-01T12:32:30Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 720 + } + ], + "route_duration": 1950, + "route_travel_distance": 7274, + "route_travel_duration": 1950 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent3.json.golden b/tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden similarity index 99% rename from tests/golden/testdata/duration_matrix_time_dependent3.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden index 30b29da..18ef55e 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent3.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/duration_matrix_time_dependent3.json.python.golden b/tests/golden/testdata/duration_matrix_time_dependent3.json.python.golden new file mode 100644 index 0000000..29f42b5 --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent3.json.python.golden @@ -0,0 +1,148 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1140, + "factor": 1, + "name": "vehicles_duration", + "value": 1140 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1140 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:19:00Z", + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 1140, + "end_time": "2023-01-01T12:19:00Z", + "start_time": "2023-01-01T12:19:00Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 1140 + } + ], + "route_duration": 1140, + "route_travel_distance": 3280, + "route_travel_duration": 1140 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 2, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/early_arrival_penalty.json.golden b/tests/golden/testdata/early_arrival_penalty.json.go.golden similarity index 99% rename from tests/golden/testdata/early_arrival_penalty.json.golden rename to tests/golden/testdata/early_arrival_penalty.json.go.golden index ca88767..3a3ab05 100644 --- a/tests/golden/testdata/early_arrival_penalty.json.golden +++ b/tests/golden/testdata/early_arrival_penalty.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/early_arrival_penalty.json.python.golden b/tests/golden/testdata/early_arrival_penalty.json.python.golden new file mode 100644 index 0000000..1642ebb --- /dev/null +++ b/tests/golden/testdata/early_arrival_penalty.json.python.golden @@ -0,0 +1,228 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty", + "objectives": [ + { + "base": 1927.0009486675262, + "factor": 1, + "name": "vehicles_duration", + "value": 1927.0009486675262 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + }, + { + "base": 2753.8426129817963, + "factor": 1, + "name": "early_arrival_penalty", + "value": 2753.8426129817963 + } + ], + "value": 4680.8435616493225 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "early_arrival_duration": 900, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "target_arrival_time": "2023-01-01T12:15:00Z", + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:05:27Z", + "cumulative_travel_distance": 6553, + "cumulative_travel_duration": 327, + "end_time": "2023-01-01T12:05:27Z", + "start_time": "2023-01-01T12:05:27Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "target_arrival_time": "2023-01-01T12:00:00Z", + "travel_distance": 6553, + "travel_duration": 327 + }, + { + "arrival_time": "2023-01-01T12:14:24Z", + "cumulative_travel_distance": 17282, + "cumulative_travel_duration": 864, + "early_arrival_duration": 936, + "end_time": "2023-01-01T12:14:24Z", + "start_time": "2023-01-01T12:14:24Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "target_arrival_time": "2023-01-01T12:30:00Z", + "travel_distance": 10729, + "travel_duration": 536 + }, + { + "arrival_time": "2023-01-01T12:22:23Z", + "cumulative_travel_distance": 26865, + "cumulative_travel_duration": 1343, + "end_time": "2023-01-01T12:22:23Z", + "start_time": "2023-01-01T12:22:23Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 9583, + "travel_duration": 479 + }, + { + "arrival_time": "2023-01-01T12:23:23Z", + "cumulative_travel_distance": 28066, + "cumulative_travel_duration": 1403, + "end_time": "2023-01-01T12:23:23Z", + "start_time": "2023-01-01T12:23:23Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "target_arrival_time": "2023-01-01T12:05:00Z", + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "arrival_time": "2023-01-01T12:29:20Z", + "cumulative_travel_distance": 35209, + "cumulative_travel_duration": 1760, + "end_time": "2023-01-01T12:29:20Z", + "start_time": "2023-01-01T12:29:20Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "target_arrival_time": "2023-01-01T12:25:00Z", + "travel_distance": 7143, + "travel_duration": 357 + }, + { + "arrival_time": "2023-01-01T12:32:07Z", + "cumulative_travel_distance": 38538, + "cumulative_travel_duration": 1927, + "end_time": "2023-01-01T12:32:07Z", + "start_time": "2023-01-01T12:32:07Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "target_arrival_time": "2023-01-01T12:10:00Z", + "travel_distance": 3329, + "travel_duration": 166 + } + ], + "route_duration": 1927, + "route_travel_distance": 38538, + "route_travel_duration": 1927 + }, + { + "id": "v2", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/initial_stops.json.golden b/tests/golden/testdata/initial_stops.json.go.golden similarity index 99% rename from tests/golden/testdata/initial_stops.json.golden rename to tests/golden/testdata/initial_stops.json.go.golden index f56dba3..b044b08 100644 --- a/tests/golden/testdata/initial_stops.json.golden +++ b/tests/golden/testdata/initial_stops.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/initial_stops.json.python.golden b/tests/golden/testdata/initial_stops.json.python.golden new file mode 100644 index 0000000..f6f584e --- /dev/null +++ b/tests/golden/testdata/initial_stops.json.python.golden @@ -0,0 +1,214 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 767.0466501941119, + "factor": 1, + "name": "vehicles_duration", + "value": 767.0466501941119 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 767.0466501941119 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + } + ], + "route_duration": 542, + "route_travel_distance": 10857, + "route_travel_duration": 542 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 224, + "route_travel_distance": 4481, + "route_travel_duration": 224 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 4, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden similarity index 99% rename from tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden rename to tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden index a45ab7f..c460be4 100644 --- a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.python.golden b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.python.golden new file mode 100644 index 0000000..776ea40 --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.python.golden @@ -0,0 +1,209 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 684.9267442164864, + "factor": 1, + "name": "vehicles_duration", + "value": 684.9267442164864 + }, + { + "base": 1000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 1000000 + } + ], + "value": 1000684.9267442165 + }, + "unplanned": [ + { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + } + ], + "route_duration": 684, + "route_travel_distance": 13696, + "route_travel_duration": 684 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 5, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 1 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden similarity index 99% rename from tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden rename to tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden index faf203f..d3f0d83 100644 --- a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.python.golden b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.python.golden new file mode 100644 index 0000000..279b8fb --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.python.golden @@ -0,0 +1,179 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1815.0046184062958, + "factor": 1, + "name": "vehicles_duration", + "value": 1815.0046184062958 + }, + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 41815.004618406296 + }, + "unplanned": [ + { + "id": "stop1", + "location": { + "lat": 51.9636, + "lon": 7.6293 + } + }, + { + "id": "stop2", + "location": { + "lat": 51.9635, + "lon": 7.6439 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v1-start", + "location": { + "lat": 51.9635, + "lon": 7.7023 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:05Z", + "cumulative_travel_distance": 1000, + "cumulative_travel_duration": 5, + "duration": 600, + "end_time": "2023-01-01T12:10:05Z", + "start_time": "2023-01-01T12:00:05Z", + "stop": { + "id": "stop5", + "location": { + "lat": 51.9635, + "lon": 7.6877 + } + }, + "travel_distance": 1000, + "travel_duration": 5 + }, + { + "arrival_time": "2023-01-01T12:10:10Z", + "cumulative_travel_distance": 2000, + "cumulative_travel_duration": 10, + "duration": 600, + "end_time": "2023-01-01T12:20:10Z", + "start_time": "2023-01-01T12:10:10Z", + "stop": { + "id": "stop4", + "location": { + "lat": 51.9635, + "lon": 7.6731 + } + }, + "travel_distance": 1000, + "travel_duration": 5 + }, + { + "arrival_time": "2023-01-01T12:20:15Z", + "cumulative_travel_distance": 3000, + "cumulative_travel_duration": 15, + "duration": 600, + "end_time": "2023-01-01T12:30:15Z", + "start_time": "2023-01-01T12:20:15Z", + "stop": { + "id": "stop3", + "location": { + "lat": 51.9635, + "lon": 7.6585 + } + }, + "travel_distance": 1000, + "travel_duration": 5 + } + ], + "route_duration": 1815, + "route_stops_duration": 1800, + "route_travel_distance": 3000, + "route_travel_duration": 15 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 2 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden similarity index 98% rename from tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden rename to tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden index b1658ec..aa6747b 100644 --- a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.python.golden b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.python.golden new file mode 100644 index 0000000..3e5e4f5 --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.python.golden @@ -0,0 +1,117 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "factor": 1, + "name": "vehicles_duration", + "value": 0 + }, + { + "base": 60000, + "factor": 1, + "name": "unplanned_penalty", + "value": 60000 + } + ], + "value": 60000 + }, + "unplanned": [ + { + "id": "stop1", + "location": { + "lat": 51.9636, + "lon": 7.6293 + } + }, + { + "id": "stop2", + "location": { + "lat": 51.9635, + "lon": 7.6439 + } + }, + { + "id": "stop3", + "location": { + "lat": 51.9635, + "lon": 7.6585 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 0, + "max_duration": 0.123, + "max_stops_in_vehicle": 0, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 9223372036854776000, + "min_travel_duration": 0.123, + "unplanned_stops": 3 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden b/tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden similarity index 99% rename from tests/golden/testdata/initial_stops_infeasible_temporal.json.golden rename to tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden index 72d2315..071d85c 100644 --- a/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/initial_stops_infeasible_temporal.json.python.golden b/tests/golden/testdata/initial_stops_infeasible_temporal.json.python.golden new file mode 100644 index 0000000..816d59b --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_temporal.json.python.golden @@ -0,0 +1,205 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 3619.999972343445, + "factor": 1, + "name": "vehicles_duration", + "value": 3619.999972343445 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 3619.999972343445 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "stop1", + "location": { + "lat": 51.96239909784941, + "lon": 7.640195127867031 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:04Z", + "cumulative_travel_distance": 999, + "cumulative_travel_duration": 4, + "duration": 600, + "end_time": "2023-01-01T12:20:04Z", + "start_time": "2023-01-01T12:10:04Z", + "stop": { + "id": "stop2", + "location": { + "lat": 51.96239639139782, + "lon": 7.654790254559089 + } + }, + "travel_distance": 999, + "travel_duration": 4 + }, + { + "arrival_time": "2023-01-01T12:20:09Z", + "cumulative_travel_distance": 1998, + "cumulative_travel_duration": 9, + "duration": 600, + "end_time": "2023-01-01T12:30:09Z", + "start_time": "2023-01-01T12:20:09Z", + "stop": { + "id": "stop3", + "location": { + "lat": 51.96239188064561, + "lon": 7.669385378901211 + } + }, + "travel_distance": 999, + "travel_duration": 4 + } + ], + "route_duration": 1809, + "route_stops_duration": 1800, + "route_travel_distance": 1998, + "route_travel_duration": 9 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "stop6", + "location": { + "lat": 51.948991884557245, + "lon": 7.6826722947853625 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:04Z", + "cumulative_travel_distance": 999, + "cumulative_travel_duration": 4, + "duration": 600, + "end_time": "2023-01-01T12:20:04Z", + "start_time": "2023-01-01T12:10:04Z", + "stop": { + "id": "stop5", + "location": { + "lat": 51.948996393136326, + "lon": 7.6680815318127316 + } + }, + "travel_distance": 999, + "travel_duration": 4 + }, + { + "arrival_time": "2023-01-01T12:20:09Z", + "cumulative_travel_distance": 1998, + "cumulative_travel_duration": 9, + "duration": 600, + "end_time": "2023-01-01T12:30:09Z", + "start_time": "2023-01-01T12:20:09Z", + "stop": { + "id": "stop4", + "location": { + "lat": 51.94899909828405, + "lon": 7.653490766493093 + } + }, + "travel_distance": 999, + "travel_duration": 4 + } + ], + "route_duration": 1809, + "route_stops_duration": 1800, + "route_travel_distance": 1998, + "route_travel_duration": 9 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden b/tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden similarity index 99% rename from tests/golden/testdata/initial_stops_infeasible_tuple.json.golden rename to tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden index cb988b6..fe2bf7b 100644 --- a/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/initial_stops_infeasible_tuple.json.python.golden b/tests/golden/testdata/initial_stops_infeasible_tuple.json.python.golden new file mode 100644 index 0000000..a3fa46e --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_tuple.json.python.golden @@ -0,0 +1,159 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 620.0061571598053, + "factor": 1, + "name": "vehicles_duration", + "value": 620.0061571598053 + }, + { + "base": 80000, + "factor": 1, + "name": "unplanned_penalty", + "value": 80000 + } + ], + "value": 80620.0061571598 + }, + "unplanned": [ + { + "id": "stop1", + "location": { + "lat": 51.9636, + "lon": 7.6293 + } + }, + { + "id": "stop3", + "location": { + "lat": 51.9635, + "lon": 7.6585 + } + }, + { + "id": "stop4", + "location": { + "lat": 51.9635, + "lon": 7.6731 + } + }, + { + "id": "stop5", + "location": { + "lat": 51.9635, + "lon": 7.6877 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v1-start", + "location": { + "lat": 51.9635, + "lon": 7.7023 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:20Z", + "cumulative_travel_distance": 4001, + "cumulative_travel_duration": 20, + "duration": 600, + "end_time": "2023-01-01T12:10:20Z", + "start_time": "2023-01-01T12:00:20Z", + "stop": { + "id": "stop2", + "location": { + "lat": 51.9635, + "lon": 7.6439 + } + }, + "travel_distance": 4001, + "travel_duration": 20 + } + ], + "route_duration": 620, + "route_stops_duration": 600, + "route_travel_distance": 4001, + "route_travel_duration": 20 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 1, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 4 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/late_arrival_penalty.json.golden b/tests/golden/testdata/late_arrival_penalty.json.go.golden similarity index 99% rename from tests/golden/testdata/late_arrival_penalty.json.golden rename to tests/golden/testdata/late_arrival_penalty.json.go.golden index c4208f5..af4e58b 100644 --- a/tests/golden/testdata/late_arrival_penalty.json.golden +++ b/tests/golden/testdata/late_arrival_penalty.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/late_arrival_penalty.json.python.golden b/tests/golden/testdata/late_arrival_penalty.json.python.golden new file mode 100644 index 0000000..4be5abf --- /dev/null +++ b/tests/golden/testdata/late_arrival_penalty.json.python.golden @@ -0,0 +1,238 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * late_arrival_penalty", + "objectives": [ + { + "base": 4273.474940299988, + "factor": 1, + "name": "vehicles_duration", + "value": 4273.474940299988 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + }, + { + "base": 634.8012353181839, + "factor": 1, + "name": "late_arrival_penalty", + "value": 634.8012353181839 + } + ], + "value": 4908.276175618172 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 450, + "end_time": "2023-01-01T12:07:30Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "target_arrival_time": "2023-01-01T12:00:00Z", + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:12:57Z", + "cumulative_travel_distance": 6553, + "cumulative_travel_duration": 327, + "duration": 450, + "end_time": "2023-01-01T12:20:27Z", + "start_time": "2023-01-01T12:12:57Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "target_arrival_time": "2023-01-01T12:15:00Z", + "travel_distance": 6553, + "travel_duration": 327 + }, + { + "arrival_time": "2023-01-01T12:22:49Z", + "cumulative_travel_distance": 9392, + "cumulative_travel_duration": 469, + "duration": 450, + "end_time": "2023-01-01T12:30:19Z", + "late_arrival_duration": 169, + "start_time": "2023-01-01T12:22:49Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "target_arrival_time": "2023-01-01T12:20:00Z", + "travel_distance": 2839, + "travel_duration": 141 + } + ], + "route_duration": 1819, + "route_stops_duration": 1350, + "route_travel_distance": 9392, + "route_travel_duration": 469 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 450, + "end_time": "2023-01-01T12:07:30Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "target_arrival_time": "2023-01-01T12:05:00Z", + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:49Z", + "cumulative_travel_distance": 3994, + "cumulative_travel_duration": 199, + "duration": 450, + "end_time": "2023-01-01T12:18:19Z", + "late_arrival_duration": 49, + "start_time": "2023-01-01T12:10:49Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "target_arrival_time": "2023-01-01T12:10:00Z", + "travel_distance": 3994, + "travel_duration": 199 + }, + { + "arrival_time": "2023-01-01T12:21:06Z", + "cumulative_travel_distance": 7323, + "cumulative_travel_duration": 366, + "duration": 450, + "end_time": "2023-01-01T12:28:36Z", + "start_time": "2023-01-01T12:21:06Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "target_arrival_time": "2023-01-01T12:25:00Z", + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "arrival_time": "2023-01-01T12:33:23Z", + "cumulative_travel_distance": 13075, + "cumulative_travel_duration": 653, + "duration": 450, + "end_time": "2023-01-01T12:40:53Z", + "late_arrival_duration": 203, + "start_time": "2023-01-01T12:33:23Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "target_arrival_time": "2023-01-01T12:30:00Z", + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 2453, + "route_stops_duration": 1800, + "route_travel_distance": 13075, + "route_travel_duration": 653 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 4, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/max_distance.json.golden b/tests/golden/testdata/max_distance.json.go.golden similarity index 99% rename from tests/golden/testdata/max_distance.json.golden rename to tests/golden/testdata/max_distance.json.go.golden index 6a04612..beba902 100644 --- a/tests/golden/testdata/max_distance.json.golden +++ b/tests/golden/testdata/max_distance.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/max_distance.json.python.golden b/tests/golden/testdata/max_distance.json.python.golden new file mode 100644 index 0000000..1c417bf --- /dev/null +++ b/tests/golden/testdata/max_distance.json.python.golden @@ -0,0 +1,176 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 148.9095949929201, + "factor": 1, + "name": "vehicles_duration", + "value": 148.9095949929201 + }, + { + "base": 6000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 6000000 + } + ], + "value": 6000148.909594993 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1201, + "cumulative_travel_duration": 60, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 60, + "route_travel_distance": 1201, + "route_travel_duration": 60 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1776, + "cumulative_travel_duration": 88, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + } + ], + "route_duration": 88, + "route_travel_distance": 1776, + "route_travel_duration": 88 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 2, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 3 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/max_duration.json.golden b/tests/golden/testdata/max_duration.json.go.golden similarity index 99% rename from tests/golden/testdata/max_duration.json.golden rename to tests/golden/testdata/max_duration.json.go.golden index 227409a..558c54b 100644 --- a/tests/golden/testdata/max_duration.json.golden +++ b/tests/golden/testdata/max_duration.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/max_duration.json.python.golden b/tests/golden/testdata/max_duration.json.python.golden new file mode 100644 index 0000000..1d18a93 --- /dev/null +++ b/tests/golden/testdata/max_duration.json.python.golden @@ -0,0 +1,204 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 2751.797765016556, + "factor": 1, + "name": "vehicles_duration", + "value": 2751.797765016556 + }, + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 42751.797765016556 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 300, + "end_time": "2023-01-01T12:05:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:15:56Z", + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 656, + "duration": 300, + "end_time": "2023-01-01T12:20:56Z", + "start_time": "2023-01-01T12:15:56Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 656 + }, + { + "arrival_time": "2023-01-01T12:24:56Z", + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 896, + "duration": 300, + "end_time": "2023-01-01T12:29:56Z", + "start_time": "2023-01-01T12:24:56Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 240 + } + ], + "route_duration": 1796, + "route_stops_duration": 900, + "route_travel_distance": 4481, + "route_travel_duration": 896 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 300, + "end_time": "2023-01-01T12:05:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:55Z", + "cumulative_travel_distance": 1776, + "cumulative_travel_duration": 355, + "duration": 300, + "end_time": "2023-01-01T12:15:55Z", + "start_time": "2023-01-01T12:10:55Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 355 + } + ], + "route_duration": 955, + "route_stops_duration": 600, + "route_travel_distance": 1776, + "route_travel_duration": 355 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 2 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/max_stops.json.golden b/tests/golden/testdata/max_stops.json.go.golden similarity index 99% rename from tests/golden/testdata/max_stops.json.golden rename to tests/golden/testdata/max_stops.json.go.golden index 337191a..33f4a3e 100644 --- a/tests/golden/testdata/max_stops.json.golden +++ b/tests/golden/testdata/max_stops.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/max_stops.json.python.golden b/tests/golden/testdata/max_stops.json.python.golden new file mode 100644 index 0000000..4a6bb7f --- /dev/null +++ b/tests/golden/testdata/max_stops.json.python.golden @@ -0,0 +1,182 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 312.949441222974, + "factor": 1, + "name": "vehicles_duration", + "value": 312.949441222974 + }, + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 40312.949441222976 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1776, + "cumulative_travel_duration": 88, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + } + ], + "route_duration": 88, + "route_travel_distance": 1776, + "route_travel_duration": 88 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 224, + "route_travel_distance": 4481, + "route_travel_duration": 224 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 2 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/max_wait_stop.json.golden b/tests/golden/testdata/max_wait_stop.json.go.golden similarity index 99% rename from tests/golden/testdata/max_wait_stop.json.golden rename to tests/golden/testdata/max_wait_stop.json.go.golden index 2695cec..42159b3 100644 --- a/tests/golden/testdata/max_wait_stop.json.golden +++ b/tests/golden/testdata/max_wait_stop.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/max_wait_stop.json.python.golden b/tests/golden/testdata/max_wait_stop.json.python.golden new file mode 100644 index 0000000..dd87de2 --- /dev/null +++ b/tests/golden/testdata/max_wait_stop.json.python.golden @@ -0,0 +1,145 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 310, + "factor": 1, + "name": "vehicles_duration", + "value": 310 + }, + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 40310 + }, + "unplanned": [ + { + "id": "Kinkaku-ji", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 10, + "end_time": "2023-01-01T12:00:10Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:10Z", + "cumulative_travel_duration": 0, + "duration": 10, + "end_time": "2023-01-01T12:05:10Z", + "start_time": "2023-01-01T12:05:00Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0, + "waiting_duration": 290 + } + ], + "route_duration": 310, + "route_stops_duration": 20, + "route_travel_duration": 0, + "route_waiting_duration": 290 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 2, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 2 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/max_wait_vehicle.json.golden b/tests/golden/testdata/max_wait_vehicle.json.go.golden similarity index 99% rename from tests/golden/testdata/max_wait_vehicle.json.golden rename to tests/golden/testdata/max_wait_vehicle.json.go.golden index d8e88e5..ce8a928 100644 --- a/tests/golden/testdata/max_wait_vehicle.json.golden +++ b/tests/golden/testdata/max_wait_vehicle.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/max_wait_vehicle.json.python.golden b/tests/golden/testdata/max_wait_vehicle.json.python.golden new file mode 100644 index 0000000..32da637 --- /dev/null +++ b/tests/golden/testdata/max_wait_vehicle.json.python.golden @@ -0,0 +1,197 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1200, + "factor": 1, + "name": "vehicles_duration", + "value": 1200 + }, + { + "base": 20000, + "factor": 1, + "name": "unplanned_penalty", + "value": 20000 + } + ], + "value": 21200 + }, + "unplanned": [ + { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:20:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0, + "waiting_duration": 1200 + }, + { + "arrival_time": "2023-01-01T12:20:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:20:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:20:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:20:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:20:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:20:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:20:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:20:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 1200, + "route_travel_duration": 0, + "route_waiting_duration": 1200 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 6, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 6, + "min_travel_duration": 0.123, + "unplanned_stops": 1 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/min_stops.json.golden b/tests/golden/testdata/min_stops.json.go.golden similarity index 99% rename from tests/golden/testdata/min_stops.json.golden rename to tests/golden/testdata/min_stops.json.go.golden index 6602431..8af7f37 100644 --- a/tests/golden/testdata/min_stops.json.golden +++ b/tests/golden/testdata/min_stops.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/min_stops.json.python.golden b/tests/golden/testdata/min_stops.json.python.golden new file mode 100644 index 0000000..8dc177c --- /dev/null +++ b/tests/golden/testdata/min_stops.json.python.golden @@ -0,0 +1,197 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * min_stops", + "objectives": [ + { + "base": 909.04663596676, + "factor": 1, + "name": "vehicles_duration", + "value": 909.04663596676 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + }, + { + "factor": 1, + "name": "min_stops", + "value": 0 + } + ], + "value": 909.04663596676 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 7320, + "cumulative_travel_duration": 366, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 9096, + "cumulative_travel_duration": 454, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 12425, + "cumulative_travel_duration": 621, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 18177, + "cumulative_travel_duration": 909, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/multi_window.json.golden b/tests/golden/testdata/multi_window.json.go.golden similarity index 99% rename from tests/golden/testdata/multi_window.json.golden rename to tests/golden/testdata/multi_window.json.go.golden index f7eff1d..0076b29 100644 --- a/tests/golden/testdata/multi_window.json.golden +++ b/tests/golden/testdata/multi_window.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/multi_window.json.python.golden b/tests/golden/testdata/multi_window.json.python.golden new file mode 100644 index 0000000..7c55df2 --- /dev/null +++ b/tests/golden/testdata/multi_window.json.python.golden @@ -0,0 +1,144 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 2400, + "factor": 1, + "name": "vehicles_duration", + "value": 2400 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 2400 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:30:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0, + "waiting_duration": 600 + }, + { + "arrival_time": "2023-01-01T12:30:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:40:00Z", + "start_time": "2023-01-01T12:30:00Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 34.96714, + "lon": 135.77159 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 2400, + "route_stops_duration": 1800, + "route_travel_duration": 0, + "route_waiting_duration": 600 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 3, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/no_mix.json.golden b/tests/golden/testdata/no_mix.json.go.golden similarity index 99% rename from tests/golden/testdata/no_mix.json.golden rename to tests/golden/testdata/no_mix.json.go.golden index 773cd61..8d8d344 100644 --- a/tests/golden/testdata/no_mix.json.golden +++ b/tests/golden/testdata/no_mix.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/no_mix.json.python.golden b/tests/golden/testdata/no_mix.json.python.golden new file mode 100644 index 0000000..74c1544 --- /dev/null +++ b/tests/golden/testdata/no_mix.json.python.golden @@ -0,0 +1,228 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 912.631200191493, + "factor": 1, + "name": "vehicles_duration", + "value": 912.631200191493 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 912.631200191493 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "mix_items": { + "hazchem": { + "name": "F-A-W-E", + "quantity": 1 + } + }, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "mix_items": { + "hazchem": { + "name": "F-A-W-E", + "quantity": 0 + } + }, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 1 + } + }, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 7311, + "cumulative_travel_duration": 365, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 2 + } + }, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 9087, + "cumulative_travel_duration": 454, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 1 + } + }, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 12497, + "cumulative_travel_duration": 625, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 0 + } + }, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 18249, + "cumulative_travel_duration": 912, + "mix_items": { + "hazchem": { + "name": "", + "quantity": 0 + } + }, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 912, + "route_travel_distance": 18249, + "route_travel_duration": 912 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/no_mix_null.json.golden b/tests/golden/testdata/no_mix_null.json.go.golden similarity index 99% rename from tests/golden/testdata/no_mix_null.json.golden rename to tests/golden/testdata/no_mix_null.json.go.golden index 76001e5..d185935 100644 --- a/tests/golden/testdata/no_mix_null.json.golden +++ b/tests/golden/testdata/no_mix_null.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/no_mix_null.json.python.golden b/tests/golden/testdata/no_mix_null.json.python.golden new file mode 100644 index 0000000..9bad82b --- /dev/null +++ b/tests/golden/testdata/no_mix_null.json.python.golden @@ -0,0 +1,247 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 362.2360713145241, + "factor": 1, + "name": "vehicles_duration", + "value": 362.2360713145241 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 362.2360713145241 + }, + "unplanned": [], + "vehicles": [ + { + "id": "truck", + "route": [ + { + "cumulative_travel_duration": 0, + "mix_items": { + "main": { + "name": "B", + "quantity": 1 + } + }, + "stop": { + "id": "east", + "location": { + "lat": 51.9624, + "lon": 7.6402 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 2000, + "cumulative_travel_duration": 100, + "mix_items": { + "main": { + "name": "B", + "quantity": 0 + } + }, + "stop": { + "id": "west", + "location": { + "lat": 51.9624, + "lon": 7.611 + } + }, + "travel_distance": 2000, + "travel_duration": 100 + }, + { + "cumulative_travel_distance": 2770, + "cumulative_travel_duration": 138, + "mix_items": { + "main": { + "name": "", + "quantity": 0 + } + }, + "stop": { + "id": "north_west", + "location": { + "lat": 51.9688, + "lon": 7.6153 + } + }, + "travel_distance": 770, + "travel_duration": 38 + }, + { + "cumulative_travel_distance": 3532, + "cumulative_travel_duration": 176, + "mix_items": { + "main": { + "name": "A", + "quantity": 1 + } + }, + "stop": { + "id": "north", + "location": { + "lat": 51.9714, + "lon": 7.6256 + } + }, + "travel_distance": 762, + "travel_duration": 38 + }, + { + "cumulative_travel_distance": 4294, + "cumulative_travel_duration": 214, + "mix_items": { + "main": { + "name": "A", + "quantity": 1 + } + }, + "stop": { + "id": "north_east", + "location": { + "lat": 51.9688, + "lon": 7.6359 + } + }, + "travel_distance": 762, + "travel_duration": 38 + }, + { + "cumulative_travel_distance": 5717, + "cumulative_travel_duration": 285, + "mix_items": { + "main": { + "name": "A", + "quantity": 1 + } + }, + "stop": { + "id": "south_east", + "location": { + "lat": 51.956, + "lon": 7.6359 + } + }, + "travel_distance": 1423, + "travel_duration": 71 + }, + { + "cumulative_travel_distance": 6479, + "cumulative_travel_duration": 324, + "mix_items": { + "main": { + "name": "A", + "quantity": 0 + } + }, + "stop": { + "id": "south", + "location": { + "lat": 51.9534, + "lon": 7.6256 + } + }, + "travel_distance": 762, + "travel_duration": 38 + }, + { + "cumulative_travel_distance": 7241, + "cumulative_travel_duration": 362, + "mix_items": { + "main": { + "name": "", + "quantity": 0 + } + }, + "stop": { + "id": "south_west", + "location": { + "lat": 51.956, + "lon": 7.6153 + } + }, + "travel_distance": 762, + "travel_duration": 38 + } + ], + "route_duration": 362, + "route_travel_distance": 7241, + "route_travel_duration": 362 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 8, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 8, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/precedence.json.golden b/tests/golden/testdata/precedence.json.go.golden similarity index 99% rename from tests/golden/testdata/precedence.json.golden rename to tests/golden/testdata/precedence.json.go.golden index 4366b4c..19a69a5 100644 --- a/tests/golden/testdata/precedence.json.golden +++ b/tests/golden/testdata/precedence.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/precedence.json.python.golden b/tests/golden/testdata/precedence.json.python.golden new file mode 100644 index 0000000..2c11379 --- /dev/null +++ b/tests/golden/testdata/precedence.json.python.golden @@ -0,0 +1,186 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1101.3248523907805, + "factor": 1, + "name": "vehicles_duration", + "value": 1101.3248523907805 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1101.3248523907805 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 7273, + "cumulative_travel_duration": 363, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3993, + "travel_duration": 199 + }, + { + "cumulative_travel_distance": 10112, + "cumulative_travel_duration": 505, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 12942, + "cumulative_travel_duration": 647, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 16271, + "cumulative_travel_duration": 813, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 22023, + "cumulative_travel_duration": 1101, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 1101, + "route_travel_distance": 22023, + "route_travel_duration": 1101 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/precedence_pathologic.json.golden b/tests/golden/testdata/precedence_pathologic.json.go.golden similarity index 99% rename from tests/golden/testdata/precedence_pathologic.json.golden rename to tests/golden/testdata/precedence_pathologic.json.go.golden index 3b2d4e3..c0c8ccb 100644 --- a/tests/golden/testdata/precedence_pathologic.json.golden +++ b/tests/golden/testdata/precedence_pathologic.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/precedence_pathologic.json.python.golden b/tests/golden/testdata/precedence_pathologic.json.python.golden new file mode 100644 index 0000000..86aa54b --- /dev/null +++ b/tests/golden/testdata/precedence_pathologic.json.python.golden @@ -0,0 +1,261 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 1841.9036093736736, + "factor": 1, + "name": "vehicles_duration", + "value": 1841.9036093736736 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 1841.9036093736736 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3935, + "cumulative_travel_duration": 196, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 3935, + "travel_duration": 196 + }, + { + "cumulative_travel_distance": 6765, + "cumulative_travel_duration": 338, + "stop": { + "id": "Nijō Castle Copy", + "location": { + "lat": 35.014239, + "lon": 135.748135 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 8541, + "cumulative_travel_duration": 427, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 8541, + "cumulative_travel_duration": 427, + "stop": { + "id": "Kyoto Imperial Palace Copy", + "location": { + "lat": 35.025431, + "lon": 135.762058 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 11951, + "cumulative_travel_duration": 597, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 11951, + "cumulative_travel_duration": 597, + "stop": { + "id": "Kinkaku-ji Copy", + "location": { + "lat": 35.039705, + "lon": 135.728899 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 15280, + "cumulative_travel_duration": 764, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 22220, + "cumulative_travel_duration": 1111, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 6940, + "travel_duration": 347 + }, + { + "cumulative_travel_distance": 22220, + "cumulative_travel_duration": 1111, + "stop": { + "id": "Arashiyama Bamboo Forest Copy", + "location": { + "lat": 35.017209, + "lon": 135.672008 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 29706, + "cumulative_travel_duration": 1485, + "stop": { + "id": "Fushimi Inari Taisha Copy", + "location": { + "lat": 34.967146, + "lon": 135.72696 + } + }, + "travel_distance": 7486, + "travel_duration": 374 + }, + { + "cumulative_travel_distance": 35632, + "cumulative_travel_duration": 1781, + "stop": { + "id": "Gionmachi Copy", + "location": { + "lat": 35.002457, + "lon": 135.775683 + } + }, + "travel_distance": 5926, + "travel_duration": 296 + }, + { + "cumulative_travel_distance": 36833, + "cumulative_travel_duration": 1841, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 1841, + "route_travel_distance": 36833, + "route_travel_duration": 1841 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 13, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 13, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/start_level.json.golden b/tests/golden/testdata/start_level.json.go.golden similarity index 99% rename from tests/golden/testdata/start_level.json.golden rename to tests/golden/testdata/start_level.json.go.golden index 4356051..69f25a1 100644 --- a/tests/golden/testdata/start_level.json.golden +++ b/tests/golden/testdata/start_level.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/start_level.json.python.golden b/tests/golden/testdata/start_level.json.python.golden new file mode 100644 index 0000000..d1e8478 --- /dev/null +++ b/tests/golden/testdata/start_level.json.python.golden @@ -0,0 +1,199 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 365.6409371878048, + "factor": 1, + "name": "vehicles_duration", + "value": 365.6409371878048 + }, + { + "base": 3000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 3000000 + } + ], + "value": 3000365.6409371877 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 7311, + "cumulative_travel_duration": 365, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 2830, + "travel_duration": 141 + } + ], + "route_duration": 365, + "route_travel_distance": 7311, + "route_travel_duration": 365 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 4, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 4, + "min_travel_duration": 0.123, + "unplanned_stops": 3 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/start_time_window.json.golden b/tests/golden/testdata/start_time_window.json.go.golden similarity index 99% rename from tests/golden/testdata/start_time_window.json.golden rename to tests/golden/testdata/start_time_window.json.go.golden index 13dbc58..7a7eeeb 100644 --- a/tests/golden/testdata/start_time_window.json.golden +++ b/tests/golden/testdata/start_time_window.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/start_time_window.json.python.golden b/tests/golden/testdata/start_time_window.json.python.golden new file mode 100644 index 0000000..6c49b93 --- /dev/null +++ b/tests/golden/testdata/start_time_window.json.python.golden @@ -0,0 +1,227 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 3887.616171836853, + "factor": 1, + "name": "vehicles_duration", + "value": 3887.616171836853 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 3887.616171836853 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 300, + "end_time": "2023-01-01T12:05:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:07:44Z", + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "duration": 300, + "end_time": "2023-01-01T12:12:44Z", + "start_time": "2023-01-01T12:07:44Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "arrival_time": "2023-01-01T12:16:03Z", + "cumulative_travel_distance": 7273, + "cumulative_travel_duration": 363, + "duration": 300, + "end_time": "2023-01-01T12:21:03Z", + "start_time": "2023-01-01T12:16:03Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 3993, + "travel_duration": 199 + }, + { + "arrival_time": "2023-01-01T12:23:54Z", + "cumulative_travel_distance": 10683, + "cumulative_travel_duration": 534, + "duration": 300, + "end_time": "2023-01-01T12:30:00Z", + "start_time": "2023-01-01T12:25:00Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170, + "waiting_duration": 66 + }, + { + "arrival_time": "2023-01-01T12:34:47Z", + "cumulative_travel_distance": 16435, + "cumulative_travel_duration": 821, + "duration": 300, + "end_time": "2023-01-01T12:39:47Z", + "start_time": "2023-01-01T12:34:47Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 2387, + "route_stops_duration": 1500, + "route_travel_distance": 16435, + "route_travel_duration": 821, + "route_waiting_duration": 66 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 300, + "end_time": "2023-01-01T12:15:00Z", + "start_time": "2023-01-01T12:10:00Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0, + "waiting_duration": 600 + }, + { + "arrival_time": "2023-01-01T12:17:21Z", + "cumulative_travel_distance": 2830, + "cumulative_travel_duration": 141, + "duration": 300, + "end_time": "2023-01-01T12:25:00Z", + "start_time": "2023-01-01T12:20:00Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2830, + "travel_duration": 141, + "waiting_duration": 159 + } + ], + "route_duration": 1500, + "route_stops_duration": 600, + "route_travel_distance": 2830, + "route_travel_duration": 141, + "route_waiting_duration": 759 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 5, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/stop_duration.json.golden b/tests/golden/testdata/stop_duration.json.go.golden similarity index 99% rename from tests/golden/testdata/stop_duration.json.golden rename to tests/golden/testdata/stop_duration.json.go.golden index ccb4716..7325b8d 100644 --- a/tests/golden/testdata/stop_duration.json.golden +++ b/tests/golden/testdata/stop_duration.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/stop_duration.json.python.golden b/tests/golden/testdata/stop_duration.json.python.golden new file mode 100644 index 0000000..0cccff0 --- /dev/null +++ b/tests/golden/testdata/stop_duration.json.python.golden @@ -0,0 +1,226 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 2109.046635866165, + "factor": 1, + "name": "vehicles_duration", + "value": 2109.046635866165 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 2109.046635866165 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:04:47Z", + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "end_time": "2023-01-01T12:04:47Z", + "start_time": "2023-01-01T12:04:47Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "arrival_time": "2023-01-01T12:07:34Z", + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "duration": 180, + "end_time": "2023-01-01T12:10:34Z", + "start_time": "2023-01-01T12:07:34Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "arrival_time": "2023-01-01T12:12:02Z", + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "duration": 600, + "end_time": "2023-01-01T12:22:02Z", + "start_time": "2023-01-01T12:12:02Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "arrival_time": "2023-01-01T12:24:24Z", + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "end_time": "2023-01-01T12:24:24Z", + "start_time": "2023-01-01T12:24:24Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "arrival_time": "2023-01-01T12:25:25Z", + "cumulative_travel_distance": 14897, + "cumulative_travel_duration": 745, + "duration": 120, + "end_time": "2023-01-01T12:27:25Z", + "start_time": "2023-01-01T12:25:25Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "arrival_time": "2023-01-01T12:30:09Z", + "cumulative_travel_distance": 18177, + "cumulative_travel_duration": 909, + "duration": 300, + "end_time": "2023-01-01T12:35:09Z", + "start_time": "2023-01-01T12:30:09Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 2109, + "route_stops_duration": 1200, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/stop_duration_multiplier.json.golden b/tests/golden/testdata/stop_duration_multiplier.json.go.golden similarity index 99% rename from tests/golden/testdata/stop_duration_multiplier.json.golden rename to tests/golden/testdata/stop_duration_multiplier.json.go.golden index 969f682..69cc789 100644 --- a/tests/golden/testdata/stop_duration_multiplier.json.golden +++ b/tests/golden/testdata/stop_duration_multiplier.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/stop_duration_multiplier.json.python.golden b/tests/golden/testdata/stop_duration_multiplier.json.python.golden new file mode 100644 index 0000000..852beff --- /dev/null +++ b/tests/golden/testdata/stop_duration_multiplier.json.python.golden @@ -0,0 +1,226 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 3309.046635866165, + "factor": 1, + "name": "vehicles_duration", + "value": 3309.046635866165 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 3309.046635866165 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:04:47Z", + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "end_time": "2023-01-01T12:04:47Z", + "start_time": "2023-01-01T12:04:47Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 5752, + "travel_duration": 287 + }, + { + "arrival_time": "2023-01-01T12:07:34Z", + "cumulative_travel_distance": 9081, + "cumulative_travel_duration": 454, + "duration": 360, + "end_time": "2023-01-01T12:13:34Z", + "start_time": "2023-01-01T12:07:34Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "arrival_time": "2023-01-01T12:15:02Z", + "cumulative_travel_distance": 10857, + "cumulative_travel_duration": 542, + "duration": 1200, + "end_time": "2023-01-01T12:35:02Z", + "start_time": "2023-01-01T12:15:02Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "arrival_time": "2023-01-01T12:37:24Z", + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "end_time": "2023-01-01T12:37:24Z", + "start_time": "2023-01-01T12:37:24Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "arrival_time": "2023-01-01T12:38:25Z", + "cumulative_travel_distance": 14897, + "cumulative_travel_duration": 745, + "duration": 240, + "end_time": "2023-01-01T12:42:25Z", + "start_time": "2023-01-01T12:38:25Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "arrival_time": "2023-01-01T12:45:09Z", + "cumulative_travel_distance": 18177, + "cumulative_travel_duration": 909, + "duration": 600, + "end_time": "2023-01-01T12:55:09Z", + "start_time": "2023-01-01T12:45:09Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 3309, + "route_stops_duration": 2400, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 7, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 7, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/stop_groups.json.golden b/tests/golden/testdata/stop_groups.json.go.golden similarity index 99% rename from tests/golden/testdata/stop_groups.json.golden rename to tests/golden/testdata/stop_groups.json.go.golden index 62c3723..d46f51f 100644 --- a/tests/golden/testdata/stop_groups.json.golden +++ b/tests/golden/testdata/stop_groups.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/stop_groups.json.python.golden b/tests/golden/testdata/stop_groups.json.python.golden new file mode 100644 index 0000000..383d50d --- /dev/null +++ b/tests/golden/testdata/stop_groups.json.python.golden @@ -0,0 +1,231 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 823.605193191854, + "factor": 1, + "name": "vehicles_duration", + "value": 823.605193191854 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 823.605193191854 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 164, + "route_travel_distance": 3280, + "route_travel_duration": 164 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 2839, + "cumulative_travel_duration": 141, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 6249, + "cumulative_travel_duration": 312, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + } + ], + "route_duration": 312, + "route_travel_distance": 6249, + "route_travel_duration": 312 + }, + { + "id": "v3", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v3-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 6940, + "cumulative_travel_duration": 347, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 347, + "route_travel_distance": 6940, + "route_travel_duration": 347 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 3, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 2, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/template_input.json.golden b/tests/golden/testdata/template_input.json.go.golden similarity index 99% rename from tests/golden/testdata/template_input.json.golden rename to tests/golden/testdata/template_input.json.go.golden index 45ee5ea..64558a9 100644 --- a/tests/golden/testdata/template_input.json.golden +++ b/tests/golden/testdata/template_input.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/template_input.json.python.golden b/tests/golden/testdata/template_input.json.python.golden new file mode 100644 index 0000000..fb77914 --- /dev/null +++ b/tests/golden/testdata/template_input.json.python.golden @@ -0,0 +1,596 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicle_activation_penalty + 1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty + 1 * late_arrival_penalty", + "objectives": [ + { + "base": 4000, + "factor": 1, + "name": "vehicle_activation_penalty", + "value": 4000 + }, + { + "base": 34394.3133084774, + "factor": 1, + "name": "vehicles_duration", + "value": 34394.3133084774 + }, + { + "base": 1400000, + "factor": 1, + "name": "unplanned_penalty", + "value": 1400000 + }, + { + "factor": 1, + "name": "early_arrival_penalty", + "value": 0 + }, + { + "base": 621271.1251366138, + "factor": 1, + "name": "late_arrival_penalty", + "value": 621271.1251366138 + } + ], + "value": 2059665.4384450912 + }, + "unplanned": [ + { + "id": "s16", + "location": { + "lat": 35.83458, + "lon": -78.63216 + } + }, + { + "id": "s22", + "location": { + "lat": 35.962635, + "lon": -78.828547 + } + }, + { + "id": "s23", + "location": { + "lat": 35.84616, + "lon": -78.60914 + } + }, + { + "id": "s24", + "location": { + "lat": 35.740605, + "lon": -78.65521 + } + }, + { + "id": "s25", + "location": { + "lat": 35.887575, + "lon": -78.92051 + } + }, + { + "id": "s26", + "location": { + "lat": 35.823865, + "lon": -78.84058 + } + }, + { + "id": "s4", + "location": { + "lat": 35.77772, + "lon": -78.505745 + } + } + ], + "vehicles": [ + { + "id": "vehicle-0", + "route": [ + { + "arrival_time": "2023-01-01T06:00:00-06:00", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T06:00:00-06:00", + "start_time": "2023-01-01T06:00:00-06:00", + "stop": { + "id": "vehicle-0-start", + "location": { + "lat": 35.791729813680874, + "lon": -78.7401685145487 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T06:09:12-06:00", + "cumulative_travel_distance": 5524, + "cumulative_travel_duration": 552, + "duration": 300, + "end_time": "2023-01-01T06:14:12-06:00", + "late_arrival_duration": 7752, + "start_time": "2023-01-01T06:09:12-06:00", + "stop": { + "id": "s7", + "location": { + "lat": 35.74261, + "lon": -78.749391 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 5524, + "travel_duration": 552 + }, + { + "arrival_time": "2023-01-01T06:28:29-06:00", + "cumulative_travel_distance": 14094, + "cumulative_travel_duration": 1409, + "duration": 300, + "end_time": "2023-01-01T06:33:29-06:00", + "late_arrival_duration": 8909, + "start_time": "2023-01-01T06:28:29-06:00", + "stop": { + "id": "s6", + "location": { + "lat": 35.813025, + "lon": -78.788025 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 8570, + "travel_duration": 857 + }, + { + "arrival_time": "2023-01-01T06:49:20-06:00", + "cumulative_travel_distance": 23604, + "cumulative_travel_duration": 2360, + "duration": 300, + "end_time": "2023-01-01T06:54:20-06:00", + "late_arrival_duration": 10160, + "start_time": "2023-01-01T06:49:20-06:00", + "stop": { + "id": "s5", + "location": { + "lat": 35.732995, + "lon": -78.75084 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 9510, + "travel_duration": 951 + }, + { + "arrival_time": "2023-01-01T07:05:29-06:00", + "cumulative_travel_distance": 30292, + "cumulative_travel_duration": 3029, + "duration": 300, + "end_time": "2023-01-01T07:10:29-06:00", + "late_arrival_duration": 11129, + "start_time": "2023-01-01T07:05:29-06:00", + "stop": { + "id": "s17", + "location": { + "lat": 35.67337, + "lon": -78.76063 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 6688, + "travel_duration": 668 + }, + { + "arrival_time": "2023-01-01T07:34:43-06:00", + "cumulative_travel_distance": 44835, + "cumulative_travel_duration": 4483, + "duration": 300, + "end_time": "2023-01-01T07:39:43-06:00", + "late_arrival_duration": 12883, + "start_time": "2023-01-01T07:34:43-06:00", + "stop": { + "id": "s1", + "location": { + "lat": 35.72389, + "lon": -78.90919 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 14543, + "travel_duration": 1454 + }, + { + "arrival_time": "2023-01-01T07:55:20-06:00", + "cumulative_travel_distance": 54198, + "cumulative_travel_duration": 5420, + "duration": 300, + "end_time": "2023-01-01T08:00:20-06:00", + "late_arrival_duration": 14120, + "start_time": "2023-01-01T07:55:20-06:00", + "stop": { + "id": "s2", + "location": { + "lat": 35.75712, + "lon": -78.813862 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 9363, + "travel_duration": 936 + }, + { + "arrival_time": "2023-01-01T08:19:08-06:00", + "cumulative_travel_distance": 65484, + "cumulative_travel_duration": 6548, + "duration": 300, + "end_time": "2023-01-01T08:24:08-06:00", + "late_arrival_duration": 15548, + "start_time": "2023-01-01T08:19:08-06:00", + "stop": { + "id": "s15", + "location": { + "lat": 35.83202, + "lon": -78.89832 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 11286, + "travel_duration": 1128 + }, + { + "arrival_time": "2023-01-01T08:43:25-06:00", + "cumulative_travel_distance": 77046, + "cumulative_travel_duration": 7705, + "duration": 300, + "end_time": "2023-01-01T08:48:25-06:00", + "late_arrival_duration": 17005, + "start_time": "2023-01-01T08:43:25-06:00", + "stop": { + "id": "s3", + "location": { + "lat": 35.932795, + "lon": -78.92996 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 11562, + "travel_duration": 1156 + }, + { + "arrival_time": "2023-01-01T09:02:48-06:00", + "cumulative_travel_distance": 85682, + "cumulative_travel_duration": 8568, + "duration": 300, + "end_time": "2023-01-01T09:07:48-06:00", + "late_arrival_duration": 18168, + "start_time": "2023-01-01T09:02:48-06:00", + "stop": { + "id": "s18", + "location": { + "lat": 36.009015, + "lon": -78.911485 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 8636, + "travel_duration": 863 + }, + { + "arrival_time": "2023-01-01T09:55:35-06:00", + "cumulative_travel_distance": 114350, + "cumulative_travel_duration": 11435, + "end_time": "2023-01-01T09:55:35-06:00", + "start_time": "2023-01-01T09:55:35-06:00", + "stop": { + "id": "vehicle-0-end", + "location": { + "lat": 35.791729813680874, + "lon": -78.7401685145487 + } + }, + "travel_distance": 28668, + "travel_duration": 2866 + } + ], + "route_duration": 14135, + "route_stops_duration": 2700, + "route_travel_distance": 114350, + "route_travel_duration": 11435 + }, + { + "id": "vehicle-1", + "route": [ + { + "arrival_time": "2023-01-01T10:00:00-06:00", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T10:00:00-06:00", + "start_time": "2023-01-01T10:00:00-06:00", + "stop": { + "id": "vehicle-1-start", + "location": { + "lat": 35.791729813680874, + "lon": -78.7401685145487 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T10:14:40-06:00", + "cumulative_travel_distance": 8801, + "cumulative_travel_duration": 880, + "duration": 300, + "end_time": "2023-01-01T10:19:40-06:00", + "late_arrival_duration": 22480, + "start_time": "2023-01-01T10:14:40-06:00", + "stop": { + "id": "s11", + "location": { + "lat": 35.77013, + "lon": -78.83403 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 8801, + "travel_duration": 880 + }, + { + "arrival_time": "2023-01-01T10:24:48-06:00", + "cumulative_travel_distance": 11889, + "cumulative_travel_duration": 1188, + "duration": 300, + "end_time": "2023-01-01T10:29:48-06:00", + "late_arrival_duration": 23088, + "start_time": "2023-01-01T10:24:48-06:00", + "stop": { + "id": "s12", + "location": { + "lat": 35.782855, + "lon": -78.864465 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 3088, + "travel_duration": 308 + }, + { + "arrival_time": "2023-01-01T10:56:41-06:00", + "cumulative_travel_distance": 28011, + "cumulative_travel_duration": 2801, + "duration": 300, + "end_time": "2023-01-01T11:01:41-06:00", + "late_arrival_duration": 25001, + "start_time": "2023-01-01T10:56:41-06:00", + "stop": { + "id": "s10", + "location": { + "lat": 35.672955, + "lon": -78.747955 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 16122, + "travel_duration": 1612 + }, + { + "arrival_time": "2023-01-01T11:17:11-06:00", + "cumulative_travel_distance": 37310, + "cumulative_travel_duration": 3731, + "duration": 300, + "end_time": "2023-01-01T11:22:11-06:00", + "late_arrival_duration": 26231, + "start_time": "2023-01-01T11:17:11-06:00", + "stop": { + "id": "s9", + "location": { + "lat": 35.64796, + "lon": -78.64972 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 9299, + "travel_duration": 929 + }, + { + "arrival_time": "2023-01-01T11:52:20-06:00", + "cumulative_travel_distance": 55404, + "cumulative_travel_duration": 5540, + "duration": 300, + "end_time": "2023-01-01T11:57:20-06:00", + "late_arrival_duration": 28340, + "start_time": "2023-01-01T11:52:20-06:00", + "stop": { + "id": "s21", + "location": { + "lat": 35.7606, + "lon": -78.50509 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 18094, + "travel_duration": 1809 + }, + { + "arrival_time": "2023-01-01T12:34:43-06:00", + "cumulative_travel_distance": 77830, + "cumulative_travel_duration": 7783, + "duration": 300, + "end_time": "2023-01-01T12:39:43-06:00", + "late_arrival_duration": 30883, + "start_time": "2023-01-01T12:34:43-06:00", + "stop": { + "id": "s14", + "location": { + "lat": 35.961465, + "lon": -78.52748 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 22426, + "travel_duration": 2242 + }, + { + "arrival_time": "2023-01-01T12:44:22-06:00", + "cumulative_travel_distance": 80624, + "cumulative_travel_duration": 8062, + "duration": 300, + "end_time": "2023-01-01T12:49:22-06:00", + "late_arrival_duration": 31462, + "start_time": "2023-01-01T12:44:22-06:00", + "stop": { + "id": "s19", + "location": { + "lat": 35.93663, + "lon": -78.522705 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 2794, + "travel_duration": 279 + }, + { + "arrival_time": "2023-01-01T13:54:40-06:00", + "cumulative_travel_distance": 119804, + "cumulative_travel_duration": 11980, + "duration": 300, + "end_time": "2023-01-01T13:59:40-06:00", + "late_arrival_duration": 35680, + "start_time": "2023-01-01T13:54:40-06:00", + "stop": { + "id": "s13", + "location": { + "lat": 35.88029, + "lon": -78.952142 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 39180, + "travel_duration": 3918 + }, + { + "arrival_time": "2023-01-01T14:18:14-06:00", + "cumulative_travel_distance": 130935, + "cumulative_travel_duration": 13094, + "duration": 300, + "end_time": "2023-01-01T14:23:14-06:00", + "late_arrival_duration": 37094, + "start_time": "2023-01-01T14:18:14-06:00", + "stop": { + "id": "s20", + "location": { + "lat": 35.97414, + "lon": -78.995162 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 11131, + "travel_duration": 1113 + }, + { + "arrival_time": "2023-01-01T14:37:18-06:00", + "cumulative_travel_distance": 139380, + "cumulative_travel_duration": 13938, + "duration": 300, + "end_time": "2023-01-01T14:42:18-06:00", + "late_arrival_duration": 38238, + "start_time": "2023-01-01T14:37:18-06:00", + "stop": { + "id": "s8", + "location": { + "lat": 36.039135, + "lon": -78.94658 + } + }, + "target_arrival_time": "2023-01-01T04:00:00-06:00", + "travel_distance": 8445, + "travel_duration": 844 + }, + { + "arrival_time": "2023-01-01T15:37:38-06:00", + "cumulative_travel_distance": 172581, + "cumulative_travel_duration": 17258, + "end_time": "2023-01-01T15:37:38-06:00", + "start_time": "2023-01-01T15:37:38-06:00", + "stop": { + "id": "vehicle-1-end", + "location": { + "lat": 35.791729813680874, + "lon": -78.7401685145487 + } + }, + "travel_distance": 33201, + "travel_duration": 3320 + } + ], + "route_duration": 20258, + "route_stops_duration": 3000, + "route_travel_distance": 172581, + "route_travel_duration": 17258 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 10, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 9, + "min_travel_duration": 0.123, + "unplanned_stops": 7 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/unplanned_penalty.json.golden b/tests/golden/testdata/unplanned_penalty.json.go.golden similarity index 99% rename from tests/golden/testdata/unplanned_penalty.json.golden rename to tests/golden/testdata/unplanned_penalty.json.go.golden index 2f8a929..3e92d01 100644 --- a/tests/golden/testdata/unplanned_penalty.json.golden +++ b/tests/golden/testdata/unplanned_penalty.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/unplanned_penalty.json.python.golden b/tests/golden/testdata/unplanned_penalty.json.python.golden new file mode 100644 index 0000000..004229c --- /dev/null +++ b/tests/golden/testdata/unplanned_penalty.json.python.golden @@ -0,0 +1,175 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 312.5445274502649, + "factor": 1, + "name": "vehicles_duration", + "value": 312.5445274502649 + }, + { + "base": 30, + "factor": 1, + "name": "unplanned_penalty", + "value": 30 + } + ], + "value": 342.5445274502649 + }, + "unplanned": [ + { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + } + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 2839, + "cumulative_travel_duration": 141, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 2839, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 6249, + "cumulative_travel_duration": 312, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3410, + "travel_duration": 170 + } + ], + "route_duration": 312, + "route_travel_distance": 6249, + "route_travel_duration": 312 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 2, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 3 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/vehicle_start_end_location.json.golden b/tests/golden/testdata/vehicle_start_end_location.json.go.golden similarity index 99% rename from tests/golden/testdata/vehicle_start_end_location.json.golden rename to tests/golden/testdata/vehicle_start_end_location.json.go.golden index e5369ee..2c3b323 100644 --- a/tests/golden/testdata/vehicle_start_end_location.json.golden +++ b/tests/golden/testdata/vehicle_start_end_location.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/vehicle_start_end_location.json.python.golden b/tests/golden/testdata/vehicle_start_end_location.json.python.golden new file mode 100644 index 0000000..b5f80f0 --- /dev/null +++ b/tests/golden/testdata/vehicle_start_end_location.json.python.golden @@ -0,0 +1,238 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 375.47202306044016, + "factor": 1, + "name": "vehicles_duration", + "value": 375.47202306044016 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 375.47202306044016 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v3", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3329, + "cumulative_travel_duration": 166, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 5105, + "cumulative_travel_duration": 255, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 5105, + "cumulative_travel_duration": 255, + "stop": { + "id": "v3-end", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 255, + "route_travel_distance": 5105, + "route_travel_duration": 255 + }, + { + "id": "v4", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v4-start", + "location": { + "lat": 35.002458, + "lon": 135.775683 + } + }, + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1201, + "cumulative_travel_duration": 60, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 2402, + "cumulative_travel_duration": 120, + "stop": { + "id": "v4-end", + "location": { + "lat": 35.002458, + "lon": 135.775683 + } + }, + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 120, + "route_travel_distance": 2402, + "route_travel_duration": 120 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 4, + "max_duration": 0.123, + "max_stops_in_vehicle": 3, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/vehicle_start_end_time.json.golden b/tests/golden/testdata/vehicle_start_end_time.json.go.golden similarity index 99% rename from tests/golden/testdata/vehicle_start_end_time.json.golden rename to tests/golden/testdata/vehicle_start_end_time.json.go.golden index 464bdd4..7c57aa6 100644 --- a/tests/golden/testdata/vehicle_start_end_time.json.golden +++ b/tests/golden/testdata/vehicle_start_end_time.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/vehicle_start_end_time.json.python.golden b/tests/golden/testdata/vehicle_start_end_time.json.python.golden new file mode 100644 index 0000000..3f8e72e --- /dev/null +++ b/tests/golden/testdata/vehicle_start_end_time.json.python.golden @@ -0,0 +1,286 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 6321.044562101364, + "factor": 1, + "name": "vehicles_duration", + "value": 6321.044562101364 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 6321.044562101364 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "duration": 600, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 600, + "route_stops_duration": 600, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:20:56Z", + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 656, + "duration": 600, + "end_time": "2023-01-01T12:30:56Z", + "start_time": "2023-01-01T12:20:56Z", + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_distance": 3280, + "travel_duration": 656 + }, + { + "arrival_time": "2023-01-01T12:44:15Z", + "cumulative_travel_distance": 7274, + "cumulative_travel_duration": 1455, + "duration": 600, + "end_time": "2023-01-01T12:54:15Z", + "start_time": "2023-01-01T12:44:15Z", + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_distance": 3994, + "travel_duration": 798 + }, + { + "arrival_time": "2023-01-01T13:05:20Z", + "cumulative_travel_distance": 10603, + "cumulative_travel_duration": 2120, + "duration": 600, + "end_time": "2023-01-01T13:15:20Z", + "start_time": "2023-01-01T13:05:20Z", + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_distance": 3329, + "travel_duration": 665 + } + ], + "route_duration": 4520, + "route_stops_duration": 2400, + "route_travel_distance": 10603, + "route_travel_duration": 2120 + }, + { + "id": "v3", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:10:00Z", + "stop": { + "id": "v3-end", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 600, + "route_stops_duration": 600, + "route_travel_duration": 0 + }, + { + "id": "v4", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v4-start", + "location": { + "lat": 35.002458, + "lon": 135.775683 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "duration": 600, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:10:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:10:00Z", + "start_time": "2023-01-01T12:10:00Z", + "stop": { + "id": "v4-end", + "location": { + "lat": 35.002458, + "lon": 135.775683 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 600, + "route_stops_duration": 600, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 4, + "max_duration": 0.123, + "max_stops_in_vehicle": 4, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/golden/testdata/vehicles_duration_objective.json.golden b/tests/golden/testdata/vehicles_duration_objective.json.go.golden similarity index 99% rename from tests/golden/testdata/vehicles_duration_objective.json.golden rename to tests/golden/testdata/vehicles_duration_objective.json.go.golden index 83ad734..330a2cc 100644 --- a/tests/golden/testdata/vehicles_duration_objective.json.golden +++ b/tests/golden/testdata/vehicles_duration_objective.json.go.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/golden/testdata/vehicles_duration_objective.json.python.golden b/tests/golden/testdata/vehicles_duration_objective.json.python.golden new file mode 100644 index 0000000..987091f --- /dev/null +++ b/tests/golden/testdata/vehicles_duration_objective.json.python.golden @@ -0,0 +1,148 @@ +{ + "options": { + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "input.json", + "model_constraints_disable_attributes": false, + "model_constraints_disable_capacities": [], + "model_constraints_disable_capacity": false, + "model_constraints_disable_distancelimit": false, + "model_constraints_disable_groups": false, + "model_constraints_disable_maximumduration": false, + "model_constraints_disable_maximumstops": false, + "model_constraints_disable_maximumwaitstop": false, + "model_constraints_disable_maximumwaitvehicle": false, + "model_constraints_disable_mixingitems": false, + "model_constraints_disable_precedence": false, + "model_constraints_disable_starttimewindows": false, + "model_constraints_disable_vehicleendtime": false, + "model_constraints_disable_vehiclestarttime": false, + "model_constraints_enable_cluster": false, + "model_objectives_capacities": "", + "model_objectives_cluster": 0, + "model_objectives_earlyarrivalpenalty": 1, + "model_objectives_latearrivalpenalty": 1, + "model_objectives_minstops": 1, + "model_objectives_travelduration": 0, + "model_objectives_unplannedpenalty": 1, + "model_objectives_vehicleactivationpenalty": 1, + "model_objectives_vehiclesduration": 1, + "model_properties_disable_durationgroups": false, + "model_properties_disable_durations": false, + "model_properties_disable_initialsolution": false, + "model_properties_disable_stopdurationmultipliers": false, + "model_validate_disable_resources": false, + "model_validate_disable_starttime": false, + "model_validate_enable_matrix": false, + "model_validate_enable_matrixasymmetrytolerance": 20, + "output": "output.json", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 + }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ + { + "base": 412.53714394569397, + "factor": 1, + "name": "vehicles_duration", + "value": 412.53714394569397 + }, + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 + } + ], + "value": 412.53714394569397 + }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "arrival_time": "2023-01-01T12:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T12:00:00Z", + "start_time": "2023-01-01T12:00:00Z", + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 + }, + { + "arrival_time": "2023-01-01T12:06:52Z", + "cumulative_travel_distance": 8250, + "cumulative_travel_duration": 412, + "end_time": "2023-01-01T12:06:52Z", + "start_time": "2023-01-01T12:06:52Z", + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } + }, + "travel_distance": 8250, + "travel_duration": 412 + } + ], + "route_duration": 412, + "route_travel_distance": 8250, + "route_travel_duration": 412 + }, + { + "id": "v2", + "route": [ + { + "arrival_time": "2023-01-01T09:00:00Z", + "cumulative_travel_duration": 0, + "end_time": "2023-01-01T09:00:00Z", + "start_time": "2023-01-01T09:00:00Z", + "stop": { + "id": "v2-start", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } + }, + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, + "statistics": { + "result": { + "custom": { + "activated_vehicles": 1, + "max_duration": 0.123, + "max_stops_in_vehicle": 1, + "max_travel_duration": 0.123, + "min_duration": 0.123, + "min_stops_in_vehicle": 1, + "min_travel_duration": 0.123, + "unplanned_stops": 0 + }, + "duration": 0.123, + "value": 0.123 + }, + "run": { + "duration": 0.123, + "iterations": 50 + }, + "schema": "v1" + } +} diff --git a/tests/inline_options/input.json.golden b/tests/inline_options/input.json.golden index e8e2918..bf14cf0 100644 --- a/tests/inline_options/input.json.golden +++ b/tests/inline_options/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/output_options/main.sh.golden b/tests/output_options/main.sh.golden index d3f0e89..851f8ed 100644 --- a/tests/output_options/main.sh.golden +++ b/tests/output_options/main.sh.golden @@ -40,7 +40,7 @@ "duration_groups": false, "initial_solution": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": { diff --git a/tests/stop_balancing_objective/input.json.golden b/tests/stop_balancing_objective/input.json.golden index f46359a..a0e76b5 100644 --- a/tests/stop_balancing_objective/input.json.golden +++ b/tests/stop_balancing_objective/input.json.golden @@ -50,7 +50,7 @@ "initial_solution": false, "stop_duration_multipliers": false }, - "maximum_time_horizon": 2592000 + "maximum_time_horizon": 15552000 }, "validate": { "disable": {