From 1730cc81c67ac34f5c47c99463b40361bdfbf654 Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 16 Dec 2024 10:01:56 +0100 Subject: [PATCH 1/5] Bumping max time horizon to 6 months --- factory/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From 5f7bc4137d7cc189e12be22f884c2e7e05c6342f Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 16 Dec 2024 10:36:15 +0100 Subject: [PATCH 2/5] Update to latest python app style --- requirements.txt | 2 +- src/tests/solve_golden/main.py | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) 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__": From 383d6c71aca476bbb85ed5e10afa74947b717361 Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 16 Dec 2024 10:40:34 +0100 Subject: [PATCH 3/5] Updating expectation for new app output style --- .../testdata/activation_penalty.json.golden | 371 +++--- tests/golden/testdata/alternates.json.golden | 449 ++++--- tests/golden/testdata/basic.json.golden | 353 +++--- tests/golden/testdata/capacity.json.golden | 385 +++--- .../compatibility_attributes.json.golden | 423 +++---- .../testdata/complex_precedence.json.golden | 817 ++++++------ tests/golden/testdata/custom_data.json.golden | 397 +++--- tests/golden/testdata/defaults.json.golden | 711 +++++------ .../testdata/direct_precedence.json.golden | 333 +++-- .../direct_precedence_linked.json.golden | 333 +++-- .../testdata/distance_matrix.json.golden | 247 ++-- .../testdata/duration_groups.json.golden | 361 +++--- ...on_groups_with_stop_multiplier.json.golden | 361 +++--- .../testdata/duration_matrix.json.golden | 237 ++-- ...uration_matrix_time_dependent0.json.golden | 255 ++-- ...uration_matrix_time_dependent1.json.golden | 255 ++-- ...uration_matrix_time_dependent2.json.golden | 255 ++-- ...uration_matrix_time_dependent3.json.golden | 261 ++-- .../early_arrival_penalty.json.golden | 413 +++--- .../golden/testdata/initial_stops.json.golden | 387 +++--- ...stops_infeasible_compatibility.json.golden | 377 +++--- ..._stops_infeasible_max_duration.json.golden | 321 +++-- ...al_stops_infeasible_remove_all.json.golden | 205 ++- ...tial_stops_infeasible_temporal.json.golden | 371 +++--- ...initial_stops_infeasible_tuple.json.golden | 279 ++--- .../testdata/late_arrival_penalty.json.golden | 429 +++---- .../golden/testdata/max_distance.json.golden | 309 ++--- .../golden/testdata/max_duration.json.golden | 367 +++--- tests/golden/testdata/max_stops.json.golden | 321 +++-- .../golden/testdata/max_wait_stop.json.golden | 255 ++-- .../testdata/max_wait_vehicle.json.golden | 355 +++--- tests/golden/testdata/min_stops.json.golden | 351 +++--- .../golden/testdata/multi_window.json.golden | 257 ++-- tests/golden/testdata/no_mix.json.golden | 417 +++---- tests/golden/testdata/no_mix_null.json.golden | 453 ++++--- tests/golden/testdata/precedence.json.golden | 333 +++-- .../precedence_pathologic.json.golden | 471 ++++--- tests/golden/testdata/start_level.json.golden | 357 +++--- .../testdata/start_time_window.json.golden | 417 +++---- .../golden/testdata/stop_duration.json.golden | 411 +++--- .../stop_duration_multiplier.json.golden | 411 +++--- tests/golden/testdata/stop_groups.json.golden | 415 +++--- .../testdata/template_input.json.golden | 1107 ++++++++--------- .../testdata/unplanned_penalty.json.golden | 309 ++--- .../vehicle_start_end_location.json.golden | 431 +++---- .../vehicle_start_end_time.json.golden | 529 ++++---- .../vehicles_duration_objective.json.golden | 261 ++-- 47 files changed, 8286 insertions(+), 9837 deletions(-) diff --git a/tests/golden/testdata/activation_penalty.json.golden b/tests/golden/testdata/activation_penalty.json.golden index 83eb552..ca09cd6 100644 --- a/tests/golden/testdata/activation_penalty.json.golden +++ b/tests/golden/testdata/activation_penalty.json.golden @@ -1,219 +1,189 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/activation_penalty.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": "/tmp/output700701039", + "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 }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + { + "base": 909.0466359667602, + "factor": 1, + "name": "vehicles_duration", + "value": 909.0466359667602 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 909.0466359667602 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicle_activation_penalty + 1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ { - "factor": 1, - "name": "vehicle_activation_penalty", - "value": 0 + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "base": 909.0466359667602, - "factor": 1, - "name": "vehicles_duration", - "value": 909.0466359667602 + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "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_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 13696, - "cumulative_travel_duration": 684, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 2839, - "travel_duration": 141 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, "statistics": { "result": { "custom": { @@ -234,8 +204,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/alternates.json.golden b/tests/golden/testdata/alternates.json.golden index 6a4b3d8..2af3bd4 100644 --- a/tests/golden/testdata/alternates.json.golden +++ b/tests/golden/testdata/alternates.json.golden @@ -1,258 +1,228 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/alternates.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": "/tmp/output3509354198", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "base": 4000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 4000000 } - } + ], + "value": 4000925.1454996876 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "alternate_stops": [ + "Inari" + ], + "id": "v1", + "route": [ { - "base": 925.145499687516, - "factor": 1, - "name": "vehicles_duration", - "value": 925.145499687516 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Arashiyama Bamboo Forest", - "location": { - "lat": 35.017209, - "lon": 135.672009 - } - }, - "travel_duration": 0 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 + "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 + } }, - { - "cumulative_travel_distance": 13696, - "cumulative_travel_duration": 684, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 2839, - "travel_duration": 141 + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 18263, + "cumulative_travel_duration": 913, + "stop": { + "id": "Inari", + "location": { + "lat": 34.9686029, + "lon": 135.7666538 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Fushimi Inari Taisha", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 236, + "cumulative_travel_duration": 11, + "stop": { + "id": "Inafuku", + "location": { + "lat": 34.9671591, + "lon": 135.770104 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 236, + "travel_duration": 11 + } + ], + "route_duration": 11, + "route_travel_distance": 236, + "route_travel_duration": 11 + } + ] + }, "statistics": { "result": { "custom": { @@ -273,8 +243,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/basic.json.golden b/tests/golden/testdata/basic.json.golden index 0f03925..b5130e5 100644 --- a/tests/golden/testdata/basic.json.golden +++ b/tests/golden/testdata/basic.json.golden @@ -1,208 +1,178 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/basic.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": "/tmp/output3121602301", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 909.0466359667602 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 909.0466359667602, - "factor": 1, - "name": "vehicles_duration", - "value": 909.0466359667602 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Arashiyama Bamboo Forest", - "location": { - "lat": 35.017209, - "lon": 135.672009 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 13696, - "cumulative_travel_duration": 684, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 2839, - "travel_duration": 141 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, "statistics": { "result": { "custom": { @@ -223,8 +193,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/capacity.json.golden b/tests/golden/testdata/capacity.json.golden index 1d26363..1ff73b3 100644 --- a/tests/golden/testdata/capacity.json.golden +++ b/tests/golden/testdata/capacity.json.golden @@ -1,225 +1,195 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/capacity.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": "/tmp/output4114792176", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1155.4805543604316 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, { - "base": 1155.4805543604316, - "factor": 1, - "name": "vehicles_duration", - "value": 1155.4805543604316 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 0 + "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 } ], - "value": 1155.4805543604316 + "route_duration": 363, + "route_travel_distance": 7274, + "route_travel_duration": 363 }, - "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 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Kinkaku-ji", - "location": { - "lat": 35.039705, - "lon": 135.728898 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3410, + "cumulative_travel_duration": 170, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } }, - { - "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 + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 6249, + "cumulative_travel_duration": 312, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 6249, - "cumulative_travel_duration": 312, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 2839, - "travel_duration": 141 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 9583, + "travel_duration": 479 + } + ], + "route_duration": 791, + "route_travel_distance": 15832, + "route_travel_duration": 791 + } + ] + }, "statistics": { "result": { "custom": { @@ -240,8 +210,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/compatibility_attributes.json.golden b/tests/golden/testdata/compatibility_attributes.json.golden index 51ff163..1573e46 100644 --- a/tests/golden/testdata/compatibility_attributes.json.golden +++ b/tests/golden/testdata/compatibility_attributes.json.golden @@ -1,245 +1,215 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/compatibility_attributes.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": "/tmp/output2291371076", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 368.0821280755173 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 368.0821280755173, - "factor": 1, - "name": "vehicles_duration", - "value": 368.0821280755173 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 0 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 } ], - "value": 368.0821280755173 + "route_duration": 0, + "route_travel_duration": 0 }, - "unplanned": [], - "vehicles": [ - { - "id": "v1", - "route": [ - { - "cumulative_travel_duration": 0, - "stop": { - "id": "v1-start", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } }, - { - "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 + "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 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Kiyomizu-dera", - "location": { - "lat": 34.994857, - "lon": 135.78506 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "cumulative_travel_distance": 1201, - "cumulative_travel_duration": 60, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 1201, - "travel_duration": 60 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1201, + "cumulative_travel_duration": 60, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -260,8 +230,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/complex_precedence.json.golden b/tests/golden/testdata/complex_precedence.json.golden index f3708e6..c9f3397 100644 --- a/tests/golden/testdata/complex_precedence.json.golden +++ b/tests/golden/testdata/complex_precedence.json.golden @@ -1,454 +1,424 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/complex_precedence.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": "/tmp/output999487419", + "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 }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + { + "factor": 1, + "name": "early_arrival_penalty", + "value": 0 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "base": 3327092.8730487823, + "factor": 1, + "name": "late_arrival_penalty", + "value": 3327092.8730487823 } - } + ], + "value": 3333285.1173214912 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty + 1 * late_arrival_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "f58d08e1-c76e-4069-84f2-5bf1f91cb5af", + "route": [ { - "base": 6192.244272708893, - "factor": 1, - "name": "vehicles_duration", - "value": 6192.244272708893 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 }, { - "factor": 1, - "name": "early_arrival_penalty", - "value": 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 }, { - "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-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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -469,8 +439,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/custom_data.json.golden b/tests/golden/testdata/custom_data.json.golden index ff8c5d3..6cecc5a 100644 --- a/tests/golden/testdata/custom_data.json.golden +++ b/tests/golden/testdata/custom_data.json.golden @@ -1,236 +1,206 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/custom_data.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": "/tmp/output588740517", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 909.0466359667602 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "custom_data": { + "dolor": "sit amet", + "lorem": "ipsum" + }, + "id": "v1", + "route": [ { - "base": 909.0466359667602, - "factor": 1, - "name": "vehicles_duration", - "value": 909.0466359667602 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "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 }, - "travel_duration": 0 + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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" }, - "travel_distance": 5752, - "travel_duration": 287 + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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" }, - "travel_distance": 3329, - "travel_duration": 166 + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } }, - { - "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 }, - "travel_distance": 1776, - "travel_duration": 88 + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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" }, - "travel_distance": 2839, - "travel_duration": 141 + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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" }, - "travel_distance": 1201, - "travel_duration": 60 + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, "statistics": { "result": { "custom": { @@ -251,8 +221,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/defaults.json.golden b/tests/golden/testdata/defaults.json.golden index 8abfc83..608a735 100644 --- a/tests/golden/testdata/defaults.json.golden +++ b/tests/golden/testdata/defaults.json.golden @@ -1,400 +1,370 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/defaults.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": "/tmp/output2507816763", + "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 }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + { + "base": 4217.552098274231, + "factor": 1, + "name": "early_arrival_penalty", + "value": 4217.552098274231 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "base": 681.325391292572, + "factor": 1, + "name": "late_arrival_penalty", + "value": 681.325391292572 } - } + ], + "value": 11249.95995926857 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty + 1 * late_arrival_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 6351.082469701767, - "factor": 1, - "name": "vehicles_duration", - "value": 6351.082469701767 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 }, { - "base": 4217.552098274231, - "factor": 1, - "name": "early_arrival_penalty", - "value": 4217.552098274231 + "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 }, { - "base": 681.325391292572, - "factor": 1, - "name": "late_arrival_penalty", - "value": 681.325391292572 + "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 } ], - "value": 11249.95995926857 + "route_duration": 1473, + "route_stops_duration": 600, + "route_travel_distance": 13106, + "route_travel_duration": 873 }, - "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 + { + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 5694, + "travel_duration": 379 + } + ], + "route_duration": 2157, + "route_stops_duration": 600, + "route_travel_distance": 23363, + "route_travel_duration": 1557 + } + ] + }, "statistics": { "result": { "custom": { @@ -415,8 +385,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/direct_precedence.json.golden b/tests/golden/testdata/direct_precedence.json.golden index 9458c1c..8a33d0c 100644 --- a/tests/golden/testdata/direct_precedence.json.golden +++ b/tests/golden/testdata/direct_precedence.json.golden @@ -1,197 +1,167 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/direct_precedence.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": "/tmp/output3811773400", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1319.8793982515122 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1319.8793982515122, - "factor": 1, - "name": "vehicles_duration", - "value": 1319.8793982515122 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 3410, + "travel_duration": 170 + }, + { + "cumulative_travel_distance": 16624, + "cumulative_travel_duration": 831, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 16624, - "cumulative_travel_duration": 831, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 5941, - "travel_duration": 297 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 1319, + "route_travel_distance": 26394, + "route_travel_duration": 1319 + } + ] + }, "statistics": { "result": { "custom": { @@ -212,8 +182,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/direct_precedence_linked.json.golden b/tests/golden/testdata/direct_precedence_linked.json.golden index 72301e4..8e1f4f5 100644 --- a/tests/golden/testdata/direct_precedence_linked.json.golden +++ b/tests/golden/testdata/direct_precedence_linked.json.golden @@ -1,197 +1,167 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/direct_precedence_linked.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": "/tmp/output3379117588", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1321.4235337700516 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1321.4235337700516, - "factor": 1, - "name": "vehicles_duration", - "value": 1321.4235337700516 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 3329, + "travel_duration": 166 + }, + { + "cumulative_travel_distance": 16842, + "cumulative_travel_duration": 842, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 16842, - "cumulative_travel_duration": 842, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 2830, - "travel_duration": 141 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 9583, + "travel_duration": 479 + } + ], + "route_duration": 1321, + "route_travel_distance": 26425, + "route_travel_duration": 1321 + } + ] + }, "statistics": { "result": { "custom": { @@ -212,8 +182,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/distance_matrix.json.golden b/tests/golden/testdata/distance_matrix.json.golden index d531fb5..a8e4ca7 100644 --- a/tests/golden/testdata/distance_matrix.json.golden +++ b/tests/golden/testdata/distance_matrix.json.golden @@ -1,150 +1,120 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/distance_matrix.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": "/tmp/output4055024084", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 335 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ - { - "base": 335, - "factor": 1, - "name": "vehicles_duration", - "value": 335 - }, + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "factor": 1, - "name": "unplanned_penalty", - "value": 0 + "cumulative_travel_duration": 0, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } + }, + "travel_duration": 0 } ], - "value": 335 + "route_duration": 0, + "route_travel_duration": 0 }, - "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 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -165,8 +135,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_groups.json.golden b/tests/golden/testdata/duration_groups.json.golden index d11a3fc..7d51f12 100644 --- a/tests/golden/testdata/duration_groups.json.golden +++ b/tests/golden/testdata/duration_groups.json.golden @@ -1,212 +1,182 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_groups.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": "/tmp/output1259747378", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1727.601181827492 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1727.601181827492, - "factor": 1, - "name": "vehicles_duration", - "value": 1727.601181827492 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "duration": 100, - "stop": { - "id": "Fushimi Inari Taisha", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 1727, + "route_stops_duration": 600, + "route_travel_distance": 22548, + "route_travel_duration": 1127 + } + ] + }, "statistics": { "result": { "custom": { @@ -227,8 +197,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden index 7c93949..2207dcf 100644 --- a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden +++ b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden @@ -1,212 +1,182 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_groups_with_stop_multiplier.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": "/tmp/output3273145035", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 2327.601181827492 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 2327.601181827492, - "factor": 1, - "name": "vehicles_duration", - "value": 2327.601181827492 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "duration": 200, - "stop": { - "id": "Fushimi Inari Taisha", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 2327, + "route_stops_duration": 1200, + "route_travel_distance": 22548, + "route_travel_duration": 1127 + } + ] + }, "statistics": { "result": { "custom": { @@ -227,8 +197,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_matrix.json.golden b/tests/golden/testdata/duration_matrix.json.golden index f1d354c..2bd131e 100644 --- a/tests/golden/testdata/duration_matrix.json.golden +++ b/tests/golden/testdata/duration_matrix.json.golden @@ -1,145 +1,115 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_matrix.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": "/tmp/output303902732", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1380 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1380, - "factor": 1, - "name": "vehicles_duration", - "value": 1380 + "cumulative_travel_duration": 0, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 720 + } + ], + "route_duration": 1380, + "route_travel_distance": 7274, + "route_travel_duration": 1380 + } + ] + }, "statistics": { "result": { "custom": { @@ -160,8 +130,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_matrix_time_dependent0.json.golden b/tests/golden/testdata/duration_matrix_time_dependent0.json.golden index 169b3f6..116cfc9 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent0.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent0.json.golden @@ -1,154 +1,124 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_matrix_time_dependent0.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": "/tmp/output366373198", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1380 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1380, - "factor": 1, - "name": "vehicles_duration", - "value": 1380 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 720 + } + ], + "route_duration": 1380, + "route_travel_distance": 7274, + "route_travel_duration": 1380 + } + ] + }, "statistics": { "result": { "custom": { @@ -169,8 +139,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_matrix_time_dependent1.json.golden b/tests/golden/testdata/duration_matrix_time_dependent1.json.golden index f21a51d..b4bf10e 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent1.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent1.json.golden @@ -1,154 +1,124 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_matrix_time_dependent1.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": "/tmp/output1204136202", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1498.8171701431274 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1498.8171701431274, - "factor": 1, - "name": "vehicles_duration", - "value": 1498.8171701431274 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 793 + } + ], + "route_duration": 1498, + "route_travel_distance": 7274, + "route_travel_duration": 1498 + } + ] + }, "statistics": { "result": { "custom": { @@ -169,8 +139,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_matrix_time_dependent2.json.golden b/tests/golden/testdata/duration_matrix_time_dependent2.json.golden index 2474759..964cd49 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent2.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent2.json.golden @@ -1,154 +1,124 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_matrix_time_dependent2.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": "/tmp/output2952080814", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1950 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1950, - "factor": 1, - "name": "vehicles_duration", - "value": 1950 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 720 + } + ], + "route_duration": 1950, + "route_travel_distance": 7274, + "route_travel_duration": 1950 + } + ] + }, "statistics": { "result": { "custom": { @@ -169,8 +139,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/duration_matrix_time_dependent3.json.golden b/tests/golden/testdata/duration_matrix_time_dependent3.json.golden index 30b29da..9961064 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent3.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent3.json.golden @@ -1,159 +1,129 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/duration_matrix_time_dependent3.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": "/tmp/output2913538799", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1140 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1140, - "factor": 1, - "name": "vehicles_duration", - "value": 1140 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 } ], - "value": 1140 + "route_duration": 1140, + "route_travel_distance": 3280, + "route_travel_duration": 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 + { + "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 + } }, - { - "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 - } - ] - } - ], + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, "statistics": { "result": { "custom": { @@ -174,8 +144,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/early_arrival_penalty.json.golden b/tests/golden/testdata/early_arrival_penalty.json.golden index ca88767..7df83a1 100644 --- a/tests/golden/testdata/early_arrival_penalty.json.golden +++ b/tests/golden/testdata/early_arrival_penalty.json.golden @@ -1,239 +1,209 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/early_arrival_penalty.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": "/tmp/output2193039604", + "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 }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "base": 2753.8426129817963, + "factor": 1, + "name": "early_arrival_penalty", + "value": 2753.8426129817963 } - } + ], + "value": 4680.8435616493225 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1927.0009486675262, - "factor": 1, - "name": "vehicles_duration", - "value": 1927.0009486675262 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -254,8 +224,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/initial_stops.json.golden b/tests/golden/testdata/initial_stops.json.golden index f56dba3..00c3412 100644 --- a/tests/golden/testdata/initial_stops.json.golden +++ b/tests/golden/testdata/initial_stops.json.golden @@ -1,225 +1,195 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/initial_stops.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": "/tmp/output3880421598", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 767.0466501941119 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 767.0466501941119, - "factor": 1, - "name": "vehicles_duration", - "value": 767.0466501941119 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Arashiyama Bamboo Forest", - "location": { - "lat": 35.017209, - "lon": 135.672009 - } - }, - "travel_duration": 0 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Fushimi Inari Taisha", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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 + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 224, + "route_travel_distance": 4481, + "route_travel_duration": 224 + } + ] + }, "statistics": { "result": { "custom": { @@ -240,8 +210,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden index a45ab7f..f9c4185 100644 --- a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden @@ -1,220 +1,190 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/initial_stops_infeasible_compatibility.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": "/tmp/output4076025289", + "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 }, - "enable": { - "cluster": false + { + "base": 1000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 1000000 } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + ], + "value": 1000684.9267442165 + }, + "unplanned": [ + { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 684.9267442164864, - "factor": 1, - "name": "vehicles_duration", - "value": 684.9267442164864 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Arashiyama Bamboo Forest", - "location": { - "lat": 35.017209, - "lon": 135.672009 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 5752, + "cumulative_travel_duration": 287, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 1776, + "travel_duration": 88 + }, + { + "cumulative_travel_distance": 13696, + "cumulative_travel_duration": 684, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -235,8 +205,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden index faf203f..de2a203 100644 --- a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden @@ -1,190 +1,160 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/initial_stops_infeasible_max_duration.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": "/tmp/output852865789", + "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 }, - "enable": { - "cluster": false + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 41815.004618406296 + }, + "unplanned": [ + { + "id": "stop1", + "location": { + "lat": 51.9636, + "lon": 7.6293 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "stop2", + "location": { + "lat": 51.9635, + "lon": 7.6439 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1815.0046184062958, - "factor": 1, - "name": "vehicles_duration", - "value": 1815.0046184062958 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 1000, + "travel_duration": 5 + } + ], + "route_duration": 1815, + "route_stops_duration": 1800, + "route_travel_distance": 3000, + "route_travel_duration": 15 + } + ] + }, "statistics": { "result": { "custom": { @@ -205,8 +175,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden index b1658ec..e352a06 100644 --- a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden @@ -1,128 +1,98 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 - } - } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/initial_stops_infeasible_remove_all.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": "/tmp/output2809169781", + "solve_duration": 10, + "solve_iterations": 50, + "solve_parallelruns": 1, + "solve_rundeterministically": true, + "solve_startsolutions": 1 }, - "solutions": [ - { - "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 - } - }, + "solution": { + "objective": { + "name": "1 * vehicles_duration + 1 * unplanned_penalty", + "objectives": [ { - "id": "stop2", - "location": { - "lat": 51.9635, - "lon": 7.6439 - } + "factor": 1, + "name": "vehicles_duration", + "value": 0 }, { - "id": "stop3", - "location": { - "lat": 51.9635, - "lon": 7.6585 - } + "base": 60000, + "factor": 1, + "name": "unplanned_penalty", + "value": 60000 } ], - "vehicles": [ - { - "id": "v1", - "route": [], - "route_duration": 0, - "route_travel_duration": 0 + "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": { @@ -143,8 +113,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden b/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden index 72d2315..2aa6895 100644 --- a/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden @@ -1,216 +1,186 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/initial_stops_infeasible_temporal.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": "/tmp/output214934900", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 3619.999972343445 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "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 + }, { - "base": 3619.999972343445, - "factor": 1, - "name": "vehicles_duration", - "value": 3619.999972343445 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 0 + "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 } ], - "value": 3619.999972343445 + "route_duration": 1809, + "route_stops_duration": 1800, + "route_travel_distance": 1998, + "route_travel_duration": 9 }, - "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 + { + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 999, + "travel_duration": 4 + } + ], + "route_duration": 1809, + "route_stops_duration": 1800, + "route_travel_distance": 1998, + "route_travel_duration": 9 + } + ] + }, "statistics": { "result": { "custom": { @@ -231,8 +201,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden b/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden index cb988b6..6cc9d72 100644 --- a/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden @@ -1,170 +1,140 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/initial_stops_infeasible_tuple.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": "/tmp/output1073475082", + "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 }, - "enable": { - "cluster": false + { + "base": 80000, + "factor": 1, + "name": "unplanned_penalty", + "value": 80000 + } + ], + "value": 80620.0061571598 + }, + "unplanned": [ + { + "id": "stop1", + "location": { + "lat": 51.9636, + "lon": 7.6293 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 + { + "id": "stop3", + "location": { + "lat": 51.9635, + "lon": 7.6585 + } }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 + { + "id": "stop4", + "location": { + "lat": 51.9635, + "lon": 7.6731 + } }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "stop5", + "location": { + "lat": 51.9635, + "lon": 7.6877 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 620.0061571598053, - "factor": 1, - "name": "vehicles_duration", - "value": 620.0061571598053 + "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 }, { - "base": 80000, - "factor": 1, - "name": "unplanned_penalty", - "value": 80000 + "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 } ], - "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 - } - ] - } - ], + "route_duration": 620, + "route_stops_duration": 600, + "route_travel_distance": 4001, + "route_travel_duration": 20 + } + ] + }, "statistics": { "result": { "custom": { @@ -185,8 +155,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/late_arrival_penalty.json.golden b/tests/golden/testdata/late_arrival_penalty.json.golden index c4208f5..7fcacd5 100644 --- a/tests/golden/testdata/late_arrival_penalty.json.golden +++ b/tests/golden/testdata/late_arrival_penalty.json.golden @@ -1,249 +1,219 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/late_arrival_penalty.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": "/tmp/output3315937452", + "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 }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "base": 634.8012353181839, + "factor": 1, + "name": "late_arrival_penalty", + "value": 634.8012353181839 } - } + ], + "value": 4908.276175618172 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * late_arrival_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 4273.474940299988, - "factor": 1, - "name": "vehicles_duration", - "value": 4273.474940299988 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 }, { - "base": 634.8012353181839, - "factor": 1, - "name": "late_arrival_penalty", - "value": 634.8012353181839 + "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 } ], - "value": 4908.276175618172 + "route_duration": 1819, + "route_stops_duration": 1350, + "route_travel_distance": 9392, + "route_travel_duration": 469 }, - "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 + { + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -264,8 +234,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/max_distance.json.golden b/tests/golden/testdata/max_distance.json.golden index 6a04612..ec7deb9 100644 --- a/tests/golden/testdata/max_distance.json.golden +++ b/tests/golden/testdata/max_distance.json.golden @@ -1,187 +1,157 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/max_distance.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": "/tmp/output1834584023", + "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 }, - "enable": { - "cluster": false + { + "base": 6000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 6000000 + } + ], + "value": 6000148.909594993 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 + { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 148.9095949929201, - "factor": 1, - "name": "vehicles_duration", - "value": 148.9095949929201 + "cumulative_travel_duration": 0, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 }, { - "base": 6000000, - "factor": 1, - "name": "unplanned_penalty", - "value": 6000000 + "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 } ], - "value": 6000148.909594993 + "route_duration": 60, + "route_travel_distance": 1201, + "route_travel_duration": 60 }, - "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 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1776, + "cumulative_travel_duration": 88, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 1776, + "travel_duration": 88 + } + ], + "route_duration": 88, + "route_travel_distance": 1776, + "route_travel_duration": 88 + } + ] + }, "statistics": { "result": { "custom": { @@ -202,8 +172,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/max_duration.json.golden b/tests/golden/testdata/max_duration.json.golden index 227409a..29542a7 100644 --- a/tests/golden/testdata/max_duration.json.golden +++ b/tests/golden/testdata/max_duration.json.golden @@ -1,215 +1,185 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/max_duration.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": "/tmp/output1707282943", + "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 }, - "enable": { - "cluster": false + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 42751.797765016556 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 2751.797765016556, - "factor": 1, - "name": "vehicles_duration", - "value": 2751.797765016556 + "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 }, { - "base": 40000, - "factor": 1, - "name": "unplanned_penalty", - "value": 40000 + "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 } ], - "value": 42751.797765016556 + "route_duration": 1796, + "route_stops_duration": 900, + "route_travel_distance": 4481, + "route_travel_duration": 896 }, - "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 + { + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 1776, + "travel_duration": 355 + } + ], + "route_duration": 955, + "route_stops_duration": 600, + "route_travel_distance": 1776, + "route_travel_duration": 355 + } + ] + }, "statistics": { "result": { "custom": { @@ -230,8 +200,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/max_stops.json.golden b/tests/golden/testdata/max_stops.json.golden index 337191a..f79c6c2 100644 --- a/tests/golden/testdata/max_stops.json.golden +++ b/tests/golden/testdata/max_stops.json.golden @@ -1,193 +1,163 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/max_stops.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": "/tmp/output682963753", + "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 }, - "enable": { - "cluster": false + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 40312.949441222976 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 312.949441222974, - "factor": 1, - "name": "vehicles_duration", - "value": 312.949441222974 + "cumulative_travel_duration": 0, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } + }, + "travel_duration": 0 }, { - "base": 40000, - "factor": 1, - "name": "unplanned_penalty", - "value": 40000 + "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 } ], - "value": 40312.949441222976 + "route_duration": 88, + "route_travel_distance": 1776, + "route_travel_duration": 88 }, - "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 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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 + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 224, + "route_travel_distance": 4481, + "route_travel_duration": 224 + } + ] + }, "statistics": { "result": { "custom": { @@ -208,8 +178,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/max_wait_stop.json.golden b/tests/golden/testdata/max_wait_stop.json.golden index 2695cec..6c65621 100644 --- a/tests/golden/testdata/max_wait_stop.json.golden +++ b/tests/golden/testdata/max_wait_stop.json.golden @@ -1,156 +1,126 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/max_wait_stop.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": "/tmp/output281284137", + "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 }, - "enable": { - "cluster": false + { + "base": 40000, + "factor": 1, + "name": "unplanned_penalty", + "value": 40000 + } + ], + "value": 40310 + }, + "unplanned": [ + { + "id": "Kinkaku-ji", + "location": { + "lat": 34.96714, + "lon": 135.77159 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 34.96714, + "lon": 135.77159 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 310, - "factor": 1, - "name": "vehicles_duration", - "value": 310 + "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 }, { - "base": 40000, - "factor": 1, - "name": "unplanned_penalty", - "value": 40000 + "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 } ], - "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 - } - ] - } - ], + "route_duration": 310, + "route_stops_duration": 20, + "route_travel_duration": 0, + "route_waiting_duration": 290 + } + ] + }, "statistics": { "result": { "custom": { @@ -171,8 +141,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/max_wait_vehicle.json.golden b/tests/golden/testdata/max_wait_vehicle.json.golden index d8e88e5..0ac297f 100644 --- a/tests/golden/testdata/max_wait_vehicle.json.golden +++ b/tests/golden/testdata/max_wait_vehicle.json.golden @@ -1,208 +1,178 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/max_wait_vehicle.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": "/tmp/output1467601539", + "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 }, - "enable": { - "cluster": false + { + "base": 20000, + "factor": 1, + "name": "unplanned_penalty", + "value": 20000 } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + ], + "value": 21200 + }, + "unplanned": [ + { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.96714, + "lon": 135.77159 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ { - "base": 1200, - "factor": 1, - "name": "vehicles_duration", - "value": 1200 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_duration": 0 + } + ], + "route_duration": 1200, + "route_travel_duration": 0, + "route_waiting_duration": 1200 + } + ] + }, "statistics": { "result": { "custom": { @@ -223,8 +193,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/min_stops.json.golden b/tests/golden/testdata/min_stops.json.golden index 6602431..a9e3c25 100644 --- a/tests/golden/testdata/min_stops.json.golden +++ b/tests/golden/testdata/min_stops.json.golden @@ -1,208 +1,178 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/min_stops.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": "/tmp/output361931986", + "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 }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "min_stops", + "value": 0 } - } + ], + "value": 909.04663596676 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty + 1 * min_stops", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [], + "route_duration": 0, + "route_travel_duration": 0 + }, + { + "id": "v2", + "route": [ { - "base": 909.04663596676, - "factor": 1, - "name": "vehicles_duration", - "value": 909.04663596676 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 }, { - "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 + } }, - { - "cumulative_travel_distance": 4481, - "cumulative_travel_duration": 224, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 1201, - "travel_duration": 60 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 909, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, "statistics": { "result": { "custom": { @@ -223,8 +193,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/multi_window.json.golden b/tests/golden/testdata/multi_window.json.golden index f7eff1d..95d5ef1 100644 --- a/tests/golden/testdata/multi_window.json.golden +++ b/tests/golden/testdata/multi_window.json.golden @@ -1,155 +1,125 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/multi_window.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": "/tmp/output3359428556", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 2400 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 2400, - "factor": 1, - "name": "vehicles_duration", - "value": 2400 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_duration": 0 + } + ], + "route_duration": 2400, + "route_stops_duration": 1800, + "route_travel_duration": 0, + "route_waiting_duration": 600 + } + ] + }, "statistics": { "result": { "custom": { @@ -170,8 +140,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/no_mix.json.golden b/tests/golden/testdata/no_mix.json.golden index 773cd61..71741e6 100644 --- a/tests/golden/testdata/no_mix.json.golden +++ b/tests/golden/testdata/no_mix.json.golden @@ -1,239 +1,209 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/no_mix.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": "/tmp/output4235708350", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 912.631200191493 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 912.631200191493, - "factor": 1, - "name": "vehicles_duration", - "value": 912.631200191493 + "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 }, { - "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 + } }, - { - "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 + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 1 + } }, - { - "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 + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 + "travel_distance": 1201, + "travel_duration": 60 + }, + { + "cumulative_travel_distance": 7311, + "cumulative_travel_duration": 365, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 2 + } }, - { - "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 + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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 + "travel_distance": 2830, + "travel_duration": 141 + }, + { + "cumulative_travel_distance": 9087, + "cumulative_travel_duration": 454, + "mix_items": { + "hazchem": { + "name": "S-P-W-E", + "quantity": 1 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -254,8 +224,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/no_mix_null.json.golden b/tests/golden/testdata/no_mix_null.json.golden index 76001e5..92be301 100644 --- a/tests/golden/testdata/no_mix_null.json.golden +++ b/tests/golden/testdata/no_mix_null.json.golden @@ -1,258 +1,228 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/no_mix_null.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": "/tmp/output3471793865", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 362.2360713145241 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "truck", + "route": [ { - "base": 362.2360713145241, - "factor": 1, - "name": "vehicles_duration", - "value": 362.2360713145241 + "cumulative_travel_duration": 0, + "mix_items": { + "main": { + "name": "B", + "quantity": 1 + } + }, + "stop": { + "id": "east", + "location": { + "lat": 51.9624, + "lon": 7.6402 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "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 + "stop": { + "id": "west", + "location": { + "lat": 51.9624, + "lon": 7.611 + } }, - { - "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 + "travel_distance": 2000, + "travel_duration": 100 + }, + { + "cumulative_travel_distance": 2770, + "cumulative_travel_duration": 138, + "mix_items": { + "main": { + "name": "", + "quantity": 0 + } }, - { - "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 + "stop": { + "id": "north_west", + "location": { + "lat": 51.9688, + "lon": 7.6153 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 762, + "travel_duration": 38 + }, + { + "cumulative_travel_distance": 4294, + "cumulative_travel_duration": 214, + "mix_items": { + "main": { + "name": "A", + "quantity": 1 + } }, - { - "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 + "stop": { + "id": "north_east", + "location": { + "lat": 51.9688, + "lon": 7.6359 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -273,8 +243,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/precedence.json.golden b/tests/golden/testdata/precedence.json.golden index 4366b4c..a265bb0 100644 --- a/tests/golden/testdata/precedence.json.golden +++ b/tests/golden/testdata/precedence.json.golden @@ -1,197 +1,167 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/precedence.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": "/tmp/output440828888", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1101.3248523907805 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1101.3248523907805, - "factor": 1, - "name": "vehicles_duration", - "value": 1101.3248523907805 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_distance": 3993, + "travel_duration": 199 + }, + { + "cumulative_travel_distance": 10112, + "cumulative_travel_duration": 505, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 10112, - "cumulative_travel_duration": 505, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 2839, - "travel_duration": 141 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 5752, + "travel_duration": 287 + } + ], + "route_duration": 1101, + "route_travel_distance": 22023, + "route_travel_duration": 1101 + } + ] + }, "statistics": { "result": { "custom": { @@ -212,8 +182,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/precedence_pathologic.json.golden b/tests/golden/testdata/precedence_pathologic.json.golden index 3b2d4e3..35ce5a9 100644 --- a/tests/golden/testdata/precedence_pathologic.json.golden +++ b/tests/golden/testdata/precedence_pathologic.json.golden @@ -1,272 +1,242 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/precedence_pathologic.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": "/tmp/output1300265168", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 1841.9036093736736 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 1841.9036093736736, - "factor": 1, - "name": "vehicles_duration", - "value": 1841.9036093736736 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_distance": 3935, - "cumulative_travel_duration": 196, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 3935, - "travel_duration": 196 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "cumulative_travel_distance": 8541, - "cumulative_travel_duration": 427, - "stop": { - "id": "Kyoto Imperial Palace Copy", - "location": { - "lat": 35.025431, - "lon": 135.762058 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 11951, + "cumulative_travel_duration": 597, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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 + "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 + } }, - { - "cumulative_travel_distance": 11951, - "cumulative_travel_duration": 597, - "stop": { - "id": "Kinkaku-ji Copy", - "location": { - "lat": 35.039705, - "lon": 135.728899 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 15280, + "cumulative_travel_duration": 764, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "cumulative_travel_distance": 22220, - "cumulative_travel_duration": 1111, - "stop": { - "id": "Arashiyama Bamboo Forest Copy", - "location": { - "lat": 35.017209, - "lon": 135.672008 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 29706, + "cumulative_travel_duration": 1485, + "stop": { + "id": "Fushimi Inari Taisha Copy", + "location": { + "lat": 34.967146, + "lon": 135.72696 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 1201, + "travel_duration": 60 + } + ], + "route_duration": 1841, + "route_travel_distance": 36833, + "route_travel_duration": 1841 + } + ] + }, "statistics": { "result": { "custom": { @@ -287,8 +257,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/start_level.json.golden b/tests/golden/testdata/start_level.json.golden index 4356051..0720d3d 100644 --- a/tests/golden/testdata/start_level.json.golden +++ b/tests/golden/testdata/start_level.json.golden @@ -1,210 +1,180 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/start_level.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": "/tmp/output1293967379", + "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 }, - "enable": { - "cluster": false + { + "base": 3000000, + "factor": 1, + "name": "unplanned_penalty", + "value": 3000000 + } + ], + "value": 3000365.6409371877 + }, + "unplanned": [ + { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 + { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 365.6409371878048, - "factor": 1, - "name": "vehicles_duration", - "value": 365.6409371878048 + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "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 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Fushimi Inari Taisha", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3280, + "cumulative_travel_duration": 164, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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 + "travel_distance": 3280, + "travel_duration": 164 + }, + { + "cumulative_travel_distance": 4481, + "cumulative_travel_duration": 224, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_distance": 4481, - "cumulative_travel_duration": 224, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_distance": 1201, - "travel_duration": 60 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -225,8 +195,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/start_time_window.json.golden b/tests/golden/testdata/start_time_window.json.golden index 13dbc58..8cb47d7 100644 --- a/tests/golden/testdata/start_time_window.json.golden +++ b/tests/golden/testdata/start_time_window.json.golden @@ -1,238 +1,208 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/start_time_window.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": "/tmp/output1078290645", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 3887.616171836853 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 3887.616171836853, - "factor": 1, - "name": "vehicles_duration", - "value": 3887.616171836853 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -253,8 +223,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/stop_duration.json.golden b/tests/golden/testdata/stop_duration.json.golden index ccb4716..709f8b5 100644 --- a/tests/golden/testdata/stop_duration.json.golden +++ b/tests/golden/testdata/stop_duration.json.golden @@ -1,237 +1,207 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/stop_duration.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": "/tmp/output663794806", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 2109.046635866165 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 2109.046635866165, - "factor": 1, - "name": "vehicles_duration", - "value": 2109.046635866165 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 2109, + "route_stops_duration": 1200, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, "statistics": { "result": { "custom": { @@ -252,8 +222,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/stop_duration_multiplier.json.golden b/tests/golden/testdata/stop_duration_multiplier.json.golden index 969f682..5ee434b 100644 --- a/tests/golden/testdata/stop_duration_multiplier.json.golden +++ b/tests/golden/testdata/stop_duration_multiplier.json.golden @@ -1,237 +1,207 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/stop_duration_multiplier.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": "/tmp/output2557505674", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 3309.046635866165 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 3309.046635866165, - "factor": 1, - "name": "vehicles_duration", - "value": 3309.046635866165 + "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 }, { - "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 3280, + "travel_duration": 164 + } + ], + "route_duration": 3309, + "route_stops_duration": 2400, + "route_travel_distance": 18177, + "route_travel_duration": 909 + } + ] + }, "statistics": { "result": { "custom": { @@ -252,8 +222,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/stop_groups.json.golden b/tests/golden/testdata/stop_groups.json.golden index 62c3723..c351188 100644 --- a/tests/golden/testdata/stop_groups.json.golden +++ b/tests/golden/testdata/stop_groups.json.golden @@ -1,242 +1,212 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/stop_groups.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": "/tmp/output3267850648", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 823.605193191854 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v1-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 + }, { - "base": 823.605193191854, - "factor": 1, - "name": "vehicles_duration", - "value": 823.605193191854 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 } ], - "value": 823.605193191854 + "route_duration": 164, + "route_travel_distance": 3280, + "route_travel_duration": 164 }, - "unplanned": [], - "vehicles": [ - { - "id": "v1", - "route": [ - { - "cumulative_travel_duration": 0, - "stop": { - "id": "v1-start", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Fushimi Inari Taisha", - "location": { - "lat": 34.967146, - "lon": 135.772695 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 2839, + "cumulative_travel_duration": 141, + "stop": { + "id": "Kyoto Imperial Palace", + "location": { + "lat": 35.025431, + "lon": 135.762057 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Gionmachi", - "location": { - "lat": 35.002457, - "lon": 135.775682 - } - }, - "travel_duration": 0 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } }, - { - "cumulative_travel_duration": 0, - "stop": { - "id": "Arashiyama Bamboo Forest", - "location": { - "lat": 35.017209, - "lon": 135.672009 - } - }, - "travel_duration": 0 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 6940, + "cumulative_travel_duration": 347, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 6940, + "travel_duration": 347 + } + ], + "route_duration": 347, + "route_travel_distance": 6940, + "route_travel_duration": 347 + } + ] + }, "statistics": { "result": { "custom": { @@ -257,8 +227,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/template_input.json.golden b/tests/golden/testdata/template_input.json.golden index 45ee5ea..be9ab08 100644 --- a/tests/golden/testdata/template_input.json.golden +++ b/tests/golden/testdata/template_input.json.golden @@ -1,607 +1,577 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/template_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": "/tmp/output2963297136", + "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 }, - "enable": { - "cluster": false + { + "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 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 + { + "id": "s22", + "location": { + "lat": 35.962635, + "lon": -78.828547 + } }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 + { + "id": "s23", + "location": { + "lat": 35.84616, + "lon": -78.60914 + } }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "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 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicle_activation_penalty + 1 * vehicles_duration + 1 * unplanned_penalty + 1 * early_arrival_penalty + 1 * late_arrival_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "vehicle-0", + "route": [ { - "base": 4000, - "factor": 1, - "name": "vehicle_activation_penalty", - "value": 4000 + "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 }, { - "base": 34394.3133084774, - "factor": 1, - "name": "vehicles_duration", - "value": 34394.3133084774 + "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 }, { - "base": 1400000, - "factor": 1, - "name": "unplanned_penalty", - "value": 1400000 + "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 }, { - "factor": 1, - "name": "early_arrival_penalty", - "value": 0 + "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 }, { - "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-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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "travel_distance": 33201, + "travel_duration": 3320 + } + ], + "route_duration": 20258, + "route_stops_duration": 3000, + "route_travel_distance": 172581, + "route_travel_duration": 17258 + } + ] + }, "statistics": { "result": { "custom": { @@ -622,8 +592,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/unplanned_penalty.json.golden b/tests/golden/testdata/unplanned_penalty.json.golden index 2f8a929..0810796 100644 --- a/tests/golden/testdata/unplanned_penalty.json.golden +++ b/tests/golden/testdata/unplanned_penalty.json.golden @@ -1,186 +1,156 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/unplanned_penalty.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": "/tmp/output3099972039", + "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 }, - "enable": { - "cluster": false + { + "base": 30, + "factor": 1, + "name": "unplanned_penalty", + "value": 30 + } + ], + "value": 342.5445274502649 + }, + "unplanned": [ + { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 } }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 + { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - "validate": { - "disable": { - "resources": false, - "start_time": false - }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 } } - }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + ], + "vehicles": [ + { + "id": "v1", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Gionmachi", + "location": { + "lat": 35.002457, + "lon": 135.775682 + } + }, + "travel_duration": 0 + }, { - "base": 312.5445274502649, - "factor": 1, - "name": "vehicles_duration", - "value": 312.5445274502649 + "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 }, { - "base": 30, - "factor": 1, - "name": "unplanned_penalty", - "value": 30 + "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 } ], - "value": 342.5445274502649 + "route_duration": 312, + "route_travel_distance": 6249, + "route_travel_duration": 312 }, - "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 + { + "id": "v2", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } }, - { - "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 - } - ] - } - ], + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, "statistics": { "result": { "custom": { @@ -201,8 +171,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/vehicle_start_end_location.json.golden b/tests/golden/testdata/vehicle_start_end_location.json.golden index e5369ee..42933cf 100644 --- a/tests/golden/testdata/vehicle_start_end_location.json.golden +++ b/tests/golden/testdata/vehicle_start_end_location.json.golden @@ -1,249 +1,219 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/vehicle_start_end_location.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": "/tmp/output3291492182", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 375.47202306044016 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "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": [ { - "base": 375.47202306044016, - "factor": 1, - "name": "vehicles_duration", - "value": 375.47202306044016 + "cumulative_travel_duration": 0, + "stop": { + "id": "v2-start", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 0 + "cumulative_travel_duration": 0, + "stop": { + "id": "Fushimi Inari Taisha", + "location": { + "lat": 34.967146, + "lon": 135.772695 + } + }, + "travel_duration": 0 } ], - "value": 375.47202306044016 + "route_duration": 0, + "route_travel_duration": 0 }, - "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 + { + "id": "v3", + "route": [ + { + "cumulative_travel_duration": 0, + "stop": { + "id": "Kinkaku-ji", + "location": { + "lat": 35.039705, + "lon": 135.728898 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 3329, + "cumulative_travel_duration": 166, + "stop": { + "id": "Nijō Castle", + "location": { + "lat": 35.014239, + "lon": 135.748134 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "travel_duration": 0 + }, + { + "cumulative_travel_distance": 1201, + "cumulative_travel_duration": 60, + "stop": { + "id": "Kiyomizu-dera", + "location": { + "lat": 34.994857, + "lon": 135.78506 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -264,8 +234,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/vehicle_start_end_time.json.golden b/tests/golden/testdata/vehicle_start_end_time.json.golden index 464bdd4..5bccde6 100644 --- a/tests/golden/testdata/vehicle_start_end_time.json.golden +++ b/tests/golden/testdata/vehicle_start_end_time.json.golden @@ -1,297 +1,267 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/vehicle_start_end_time.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": "/tmp/output619893251", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 6321.044562101364 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 6321.044562101364, - "factor": 1, - "name": "vehicles_duration", - "value": 6321.044562101364 - }, - { - "factor": 1, - "name": "unplanned_penalty", - "value": 0 + "cumulative_travel_duration": 0, + "duration": 600, + "stop": { + "id": "Arashiyama Bamboo Forest", + "location": { + "lat": 35.017209, + "lon": 135.672009 + } + }, + "travel_duration": 0 } ], - "value": 6321.044562101364 + "route_duration": 600, + "route_stops_duration": 600, + "route_travel_duration": 0 }, - "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 + { + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 + "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 + } }, - { - "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 - } - ] - } - ], + "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": { @@ -312,8 +282,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } diff --git a/tests/golden/testdata/vehicles_duration_objective.json.golden b/tests/golden/testdata/vehicles_duration_objective.json.golden index 83ad734..044f94d 100644 --- a/tests/golden/testdata/vehicles_duration_objective.json.golden +++ b/tests/golden/testdata/vehicles_duration_objective.json.golden @@ -1,159 +1,129 @@ { "options": { - "check": { - "duration": 30000000000, - "verbosity": "off" - }, - "format": { - "disable": { - "progression": true - } - }, - "model": { - "constraints": { - "disable": { - "attributes": false, - "capacities": null, - "capacity": false, - "distance_limit": false, - "groups": false, - "maximum_duration": false, - "maximum_stops": false, - "maximum_wait_stop": false, - "maximum_wait_vehicle": false, - "mixing_items": false, - "precedence": false, - "start_time_windows": false, - "vehicle_end_time": false, - "vehicle_start_time": false - }, - "enable": { - "cluster": false - } - }, - "objectives": { - "capacities": "", - "cluster": 0, - "early_arrival_penalty": 1, - "late_arrival_penalty": 1, - "min_stops": 1, - "stop_balance": 0, - "travel_duration": 0, - "unplanned_penalty": 1, - "vehicle_activation_penalty": 1, - "vehicles_duration": 1 - }, - "properties": { - "disable": { - "duration_groups": false, - "durations": false, - "initial_solution": false, - "stop_duration_multipliers": false - }, - "maximum_time_horizon": 2592000 - }, - "validate": { - "disable": { - "resources": false, - "start_time": false + "check_duration": 30, + "check_verbosity": "off", + "format_disable_progression": true, + "input": "../../../tests/golden/testdata/vehicles_duration_objective.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": "/tmp/output3854531625", + "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 }, - "enable": { - "matrix": false, - "matrix_asymmetry_tolerance": 20 + { + "factor": 1, + "name": "unplanned_penalty", + "value": 0 } - } + ], + "value": 412.53714394569397 }, - "solve": { - "duration": 10000000000, - "iterations": 50, - "parallel_runs": 1, - "run_deterministically": true, - "start_solutions": 1 - } - }, - "solutions": [ - { - "objective": { - "name": "1 * vehicles_duration + 1 * unplanned_penalty", - "objectives": [ + "unplanned": [], + "vehicles": [ + { + "id": "v1", + "route": [ { - "base": 412.53714394569397, - "factor": 1, - "name": "vehicles_duration", - "value": 412.53714394569397 + "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 }, { - "factor": 1, - "name": "unplanned_penalty", - "value": 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 } ], - "value": 412.53714394569397 + "route_duration": 412, + "route_travel_distance": 8250, + "route_travel_duration": 412 }, - "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 + { + "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 + } }, - { - "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 - } - ] - } - ], + "travel_duration": 0 + } + ], + "route_duration": 0, + "route_travel_duration": 0 + } + ] + }, "statistics": { "result": { "custom": { @@ -174,8 +144,5 @@ "iterations": 50 }, "schema": "v1" - }, - "version": { - "sdk": "VERSION" } } From 87bf099aaab01ae6472e8446214451cec44bad98 Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 16 Dec 2024 11:17:22 +0100 Subject: [PATCH 4/5] Splitting golden files for diverging output formats, updating expectations --- go.mod | 2 +- go.sum | 2 + src/tests/solve_golden/main_test.go | 5 +- tests/check/input.json.golden | 2 +- tests/custom_constraint/input.json.golden | 2 +- tests/custom_matrices/input.json.golden | 2 +- tests/custom_objective/input.json.golden | 2 +- tests/custom_operators/input.json.golden | 2 +- tests/golden/main_test.go | 1 + .../activation_penalty.json.go.golden | 241 +++++++ ... => activation_penalty.json.python.golden} | 4 +- .../golden/testdata/alternates.json.go.golden | 280 ++++++++ ...n.golden => alternates.json.python.golden} | 4 +- tests/golden/testdata/basic.json.go.golden | 230 +++++++ ...c.json.golden => basic.json.python.golden} | 4 +- tests/golden/testdata/capacity.json.go.golden | 247 +++++++ ...son.golden => capacity.json.python.golden} | 4 +- .../compatibility_attributes.json.go.golden | 267 ++++++++ ...mpatibility_attributes.json.python.golden} | 4 +- .../complex_precedence.json.go.golden | 476 +++++++++++++ ... => complex_precedence.json.python.golden} | 4 +- .../testdata/custom_data.json.go.golden | 258 +++++++ ....golden => custom_data.json.python.golden} | 4 +- tests/golden/testdata/defaults.json.go.golden | 422 ++++++++++++ ...son.golden => defaults.json.python.golden} | 4 +- .../testdata/direct_precedence.json.go.golden | 219 ++++++ ...n => direct_precedence.json.python.golden} | 4 +- .../direct_precedence_linked.json.go.golden | 219 ++++++ ...rect_precedence_linked.json.python.golden} | 4 +- .../testdata/distance_matrix.json.go.golden | 172 +++++ ...den => distance_matrix.json.python.golden} | 4 +- .../testdata/duration_groups.json.go.golden | 234 +++++++ ...den => duration_groups.json.python.golden} | 4 +- ...groups_with_stop_multiplier.json.go.golden | 234 +++++++ ...s_with_stop_multiplier.json.python.golden} | 4 +- .../testdata/duration_matrix.json.go.golden | 167 +++++ ...den => duration_matrix.json.python.golden} | 4 +- ...tion_matrix_time_dependent0.json.go.golden | 176 +++++ ...matrix_time_dependent0.json.python.golden} | 4 +- ...tion_matrix_time_dependent1.json.go.golden | 176 +++++ ...matrix_time_dependent1.json.python.golden} | 4 +- ...tion_matrix_time_dependent2.json.go.golden | 176 +++++ ...matrix_time_dependent2.json.python.golden} | 4 +- ...tion_matrix_time_dependent3.json.go.golden | 181 +++++ ...matrix_time_dependent3.json.python.golden} | 4 +- .../early_arrival_penalty.json.go.golden | 261 ++++++++ ... early_arrival_penalty.json.python.golden} | 4 +- .../testdata/initial_stops.json.go.golden | 247 +++++++ ...olden => initial_stops.json.python.golden} | 4 +- ...ps_infeasible_compatibility.json.go.golden | 242 +++++++ ...feasible_compatibility.json.python.golden} | 4 +- ...ops_infeasible_max_duration.json.go.golden | 212 ++++++ ...nfeasible_max_duration.json.python.golden} | 4 +- ...stops_infeasible_remove_all.json.go.golden | 150 +++++ ..._infeasible_remove_all.json.python.golden} | 4 +- ...l_stops_infeasible_temporal.json.go.golden | 238 +++++++ ...ps_infeasible_temporal.json.python.golden} | 4 +- ...tial_stops_infeasible_tuple.json.go.golden | 192 ++++++ ...stops_infeasible_tuple.json.python.golden} | 4 +- .../late_arrival_penalty.json.go.golden | 271 ++++++++ ...> late_arrival_penalty.json.python.golden} | 4 +- .../testdata/max_distance.json.go.golden | 209 ++++++ ...golden => max_distance.json.python.golden} | 4 +- .../testdata/max_duration.json.go.golden | 237 +++++++ ...golden => max_duration.json.python.golden} | 4 +- .../golden/testdata/max_stops.json.go.golden | 215 ++++++ ...on.golden => max_stops.json.python.golden} | 4 +- .../testdata/max_wait_stop.json.go.golden | 178 +++++ ...olden => max_wait_stop.json.python.golden} | 4 +- .../testdata/max_wait_vehicle.json.go.golden | 230 +++++++ ...en => max_wait_vehicle.json.python.golden} | 4 +- .../golden/testdata/min_stops.json.go.golden | 230 +++++++ ...on.golden => min_stops.json.python.golden} | 4 +- .../testdata/multi_window.json.go.golden | 177 +++++ ...golden => multi_window.json.python.golden} | 4 +- tests/golden/testdata/no_mix.json.go.golden | 261 ++++++++ ....json.golden => no_mix.json.python.golden} | 4 +- .../testdata/no_mix_null.json.go.golden | 280 ++++++++ ....golden => no_mix_null.json.python.golden} | 4 +- .../golden/testdata/precedence.json.go.golden | 219 ++++++ ...n.golden => precedence.json.python.golden} | 4 +- .../precedence_pathologic.json.go.golden | 294 ++++++++ ... precedence_pathologic.json.python.golden} | 4 +- .../testdata/start_level.json.go.golden | 232 +++++++ ....golden => start_level.json.python.golden} | 4 +- .../testdata/start_time_window.json.go.golden | 260 ++++++++ ...n => start_time_window.json.python.golden} | 4 +- .../testdata/stop_duration.json.go.golden | 259 ++++++++ ...olden => stop_duration.json.python.golden} | 4 +- .../stop_duration_multiplier.json.go.golden | 259 ++++++++ ...op_duration_multiplier.json.python.golden} | 4 +- .../testdata/stop_groups.json.go.golden | 264 ++++++++ ....golden => stop_groups.json.python.golden} | 4 +- .../testdata/template_input.json.go.golden | 629 ++++++++++++++++++ ...lden => template_input.json.python.golden} | 4 +- .../testdata/unplanned_penalty.json.go.golden | 208 ++++++ ...n => unplanned_penalty.json.python.golden} | 4 +- .../vehicle_start_end_location.json.go.golden | 271 ++++++++ ...cle_start_end_location.json.python.golden} | 4 +- .../vehicle_start_end_time.json.go.golden | 319 +++++++++ ...vehicle_start_end_time.json.python.golden} | 4 +- ...vehicles_duration_objective.json.go.golden | 181 +++++ ...les_duration_objective.json.python.golden} | 4 +- tests/inline_options/input.json.golden | 2 +- tests/output_options/main.sh.golden | 2 +- .../input.json.golden | 2 +- 106 files changed, 11709 insertions(+), 105 deletions(-) create mode 100644 tests/golden/testdata/activation_penalty.json.go.golden rename tests/golden/testdata/{activation_penalty.json.golden => activation_penalty.json.python.golden} (98%) create mode 100644 tests/golden/testdata/alternates.json.go.golden rename tests/golden/testdata/{alternates.json.golden => alternates.json.python.golden} (98%) create mode 100644 tests/golden/testdata/basic.json.go.golden rename tests/golden/testdata/{basic.json.golden => basic.json.python.golden} (98%) create mode 100644 tests/golden/testdata/capacity.json.go.golden rename tests/golden/testdata/{capacity.json.golden => capacity.json.python.golden} (98%) create mode 100644 tests/golden/testdata/compatibility_attributes.json.go.golden rename tests/golden/testdata/{compatibility_attributes.json.golden => compatibility_attributes.json.python.golden} (98%) create mode 100644 tests/golden/testdata/complex_precedence.json.go.golden rename tests/golden/testdata/{complex_precedence.json.golden => complex_precedence.json.python.golden} (99%) create mode 100644 tests/golden/testdata/custom_data.json.go.golden rename tests/golden/testdata/{custom_data.json.golden => custom_data.json.python.golden} (98%) create mode 100644 tests/golden/testdata/defaults.json.go.golden rename tests/golden/testdata/{defaults.json.golden => defaults.json.python.golden} (99%) create mode 100644 tests/golden/testdata/direct_precedence.json.go.golden rename tests/golden/testdata/{direct_precedence.json.golden => direct_precedence.json.python.golden} (98%) create mode 100644 tests/golden/testdata/direct_precedence_linked.json.go.golden rename tests/golden/testdata/{direct_precedence_linked.json.golden => direct_precedence_linked.json.python.golden} (97%) create mode 100644 tests/golden/testdata/distance_matrix.json.go.golden rename tests/golden/testdata/{distance_matrix.json.golden => distance_matrix.json.python.golden} (97%) create mode 100644 tests/golden/testdata/duration_groups.json.go.golden rename tests/golden/testdata/{duration_groups.json.golden => duration_groups.json.python.golden} (98%) create mode 100644 tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden rename tests/golden/testdata/{duration_groups_with_stop_multiplier.json.golden => duration_groups_with_stop_multiplier.json.python.golden} (97%) create mode 100644 tests/golden/testdata/duration_matrix.json.go.golden rename tests/golden/testdata/{duration_matrix.json.golden => duration_matrix.json.python.golden} (97%) create mode 100644 tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden rename tests/golden/testdata/{duration_matrix_time_dependent0.json.golden => duration_matrix_time_dependent0.json.python.golden} (97%) create mode 100644 tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden rename tests/golden/testdata/{duration_matrix_time_dependent1.json.golden => duration_matrix_time_dependent1.json.python.golden} (97%) create mode 100644 tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden rename tests/golden/testdata/{duration_matrix_time_dependent2.json.golden => duration_matrix_time_dependent2.json.python.golden} (97%) create mode 100644 tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden rename tests/golden/testdata/{duration_matrix_time_dependent3.json.golden => duration_matrix_time_dependent3.json.python.golden} (97%) create mode 100644 tests/golden/testdata/early_arrival_penalty.json.go.golden rename tests/golden/testdata/{early_arrival_penalty.json.golden => early_arrival_penalty.json.python.golden} (98%) create mode 100644 tests/golden/testdata/initial_stops.json.go.golden rename tests/golden/testdata/{initial_stops.json.golden => initial_stops.json.python.golden} (98%) create mode 100644 tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden rename tests/golden/testdata/{initial_stops_infeasible_compatibility.json.golden => initial_stops_infeasible_compatibility.json.python.golden} (97%) create mode 100644 tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden rename tests/golden/testdata/{initial_stops_infeasible_max_duration.json.golden => initial_stops_infeasible_max_duration.json.python.golden} (97%) create mode 100644 tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden rename tests/golden/testdata/{initial_stops_infeasible_remove_all.json.golden => initial_stops_infeasible_remove_all.json.python.golden} (96%) create mode 100644 tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden rename tests/golden/testdata/{initial_stops_infeasible_temporal.json.golden => initial_stops_infeasible_temporal.json.python.golden} (98%) create mode 100644 tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden rename tests/golden/testdata/{initial_stops_infeasible_tuple.json.golden => initial_stops_infeasible_tuple.json.python.golden} (97%) create mode 100644 tests/golden/testdata/late_arrival_penalty.json.go.golden rename tests/golden/testdata/{late_arrival_penalty.json.golden => late_arrival_penalty.json.python.golden} (98%) create mode 100644 tests/golden/testdata/max_distance.json.go.golden rename tests/golden/testdata/{max_distance.json.golden => max_distance.json.python.golden} (97%) create mode 100644 tests/golden/testdata/max_duration.json.go.golden rename tests/golden/testdata/{max_duration.json.golden => max_duration.json.python.golden} (98%) create mode 100644 tests/golden/testdata/max_stops.json.go.golden rename tests/golden/testdata/{max_stops.json.golden => max_stops.json.python.golden} (98%) create mode 100644 tests/golden/testdata/max_wait_stop.json.go.golden rename tests/golden/testdata/{max_wait_stop.json.golden => max_wait_stop.json.python.golden} (97%) create mode 100644 tests/golden/testdata/max_wait_vehicle.json.go.golden rename tests/golden/testdata/{max_wait_vehicle.json.golden => max_wait_vehicle.json.python.golden} (98%) create mode 100644 tests/golden/testdata/min_stops.json.go.golden rename tests/golden/testdata/{min_stops.json.golden => min_stops.json.python.golden} (98%) create mode 100644 tests/golden/testdata/multi_window.json.go.golden rename tests/golden/testdata/{multi_window.json.golden => multi_window.json.python.golden} (97%) create mode 100644 tests/golden/testdata/no_mix.json.go.golden rename tests/golden/testdata/{no_mix.json.golden => no_mix.json.python.golden} (98%) create mode 100644 tests/golden/testdata/no_mix_null.json.go.golden rename tests/golden/testdata/{no_mix_null.json.golden => no_mix_null.json.python.golden} (98%) create mode 100644 tests/golden/testdata/precedence.json.go.golden rename tests/golden/testdata/{precedence.json.golden => precedence.json.python.golden} (98%) create mode 100644 tests/golden/testdata/precedence_pathologic.json.go.golden rename tests/golden/testdata/{precedence_pathologic.json.golden => precedence_pathologic.json.python.golden} (98%) create mode 100644 tests/golden/testdata/start_level.json.go.golden rename tests/golden/testdata/{start_level.json.golden => start_level.json.python.golden} (98%) create mode 100644 tests/golden/testdata/start_time_window.json.go.golden rename tests/golden/testdata/{start_time_window.json.golden => start_time_window.json.python.golden} (98%) create mode 100644 tests/golden/testdata/stop_duration.json.go.golden rename tests/golden/testdata/{stop_duration.json.golden => stop_duration.json.python.golden} (98%) create mode 100644 tests/golden/testdata/stop_duration_multiplier.json.go.golden rename tests/golden/testdata/{stop_duration_multiplier.json.golden => stop_duration_multiplier.json.python.golden} (98%) create mode 100644 tests/golden/testdata/stop_groups.json.go.golden rename tests/golden/testdata/{stop_groups.json.golden => stop_groups.json.python.golden} (98%) create mode 100644 tests/golden/testdata/template_input.json.go.golden rename tests/golden/testdata/{template_input.json.golden => template_input.json.python.golden} (99%) create mode 100644 tests/golden/testdata/unplanned_penalty.json.go.golden rename tests/golden/testdata/{unplanned_penalty.json.golden => unplanned_penalty.json.python.golden} (97%) create mode 100644 tests/golden/testdata/vehicle_start_end_location.json.go.golden rename tests/golden/testdata/{vehicle_start_end_location.json.golden => vehicle_start_end_location.json.python.golden} (98%) create mode 100644 tests/golden/testdata/vehicle_start_end_time.json.go.golden rename tests/golden/testdata/{vehicle_start_end_time.json.golden => vehicle_start_end_time.json.python.golden} (98%) create mode 100644 tests/golden/testdata/vehicles_duration_objective.json.go.golden rename tests/golden/testdata/{vehicles_duration_objective.json.golden => vehicles_duration_objective.json.python.golden} (97%) diff --git a/go.mod b/go.mod index 556a09d..5cd9453 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-0.20241216100747-7da66dbefd1c gonum.org/v1/gonum v0.14.0 ) diff --git a/go.sum b/go.sum index 029c8a1..f1b6527 100644 --- a/go.sum +++ b/go.sum @@ -303,6 +303,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY 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-0.20241216100747-7da66dbefd1c h1:Tm248WPtjW1Fo9BO2FNIwVuroKasmORfgQq0DtLFbbE= +github.com/nextmv-io/sdk v1.8.2-0.20241216100747-7da66dbefd1c/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/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.go.golden b/tests/golden/testdata/activation_penalty.json.go.golden new file mode 100644 index 0000000..5a5e183 --- /dev/null +++ b/tests/golden/testdata/activation_penalty.json.go.golden @@ -0,0 +1,241 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/activation_penalty.json.golden b/tests/golden/testdata/activation_penalty.json.python.golden similarity index 98% rename from tests/golden/testdata/activation_penalty.json.golden rename to tests/golden/testdata/activation_penalty.json.python.golden index ca09cd6..fbe8fab 100644 --- a/tests/golden/testdata/activation_penalty.json.golden +++ b/tests/golden/testdata/activation_penalty.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/activation_penalty.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output700701039", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/alternates.json.go.golden b/tests/golden/testdata/alternates.json.go.golden new file mode 100644 index 0000000..6a7b1b6 --- /dev/null +++ b/tests/golden/testdata/alternates.json.go.golden @@ -0,0 +1,280 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/alternates.json.golden b/tests/golden/testdata/alternates.json.python.golden similarity index 98% rename from tests/golden/testdata/alternates.json.golden rename to tests/golden/testdata/alternates.json.python.golden index 2af3bd4..48a6658 100644 --- a/tests/golden/testdata/alternates.json.golden +++ b/tests/golden/testdata/alternates.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/alternates.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3509354198", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/basic.json.go.golden b/tests/golden/testdata/basic.json.go.golden new file mode 100644 index 0000000..e38ddd1 --- /dev/null +++ b/tests/golden/testdata/basic.json.go.golden @@ -0,0 +1,230 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/basic.json.golden b/tests/golden/testdata/basic.json.python.golden similarity index 98% rename from tests/golden/testdata/basic.json.golden rename to tests/golden/testdata/basic.json.python.golden index b5130e5..96e8252 100644 --- a/tests/golden/testdata/basic.json.golden +++ b/tests/golden/testdata/basic.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/basic.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3121602301", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/capacity.json.go.golden b/tests/golden/testdata/capacity.json.go.golden new file mode 100644 index 0000000..62e9682 --- /dev/null +++ b/tests/golden/testdata/capacity.json.go.golden @@ -0,0 +1,247 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/capacity.json.golden b/tests/golden/testdata/capacity.json.python.golden similarity index 98% rename from tests/golden/testdata/capacity.json.golden rename to tests/golden/testdata/capacity.json.python.golden index 1ff73b3..f6a9639 100644 --- a/tests/golden/testdata/capacity.json.golden +++ b/tests/golden/testdata/capacity.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/capacity.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output4114792176", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/compatibility_attributes.json.go.golden b/tests/golden/testdata/compatibility_attributes.json.go.golden new file mode 100644 index 0000000..990dc8a --- /dev/null +++ b/tests/golden/testdata/compatibility_attributes.json.go.golden @@ -0,0 +1,267 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/compatibility_attributes.json.golden b/tests/golden/testdata/compatibility_attributes.json.python.golden similarity index 98% rename from tests/golden/testdata/compatibility_attributes.json.golden rename to tests/golden/testdata/compatibility_attributes.json.python.golden index 1573e46..f3bcedc 100644 --- a/tests/golden/testdata/compatibility_attributes.json.golden +++ b/tests/golden/testdata/compatibility_attributes.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/compatibility_attributes.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2291371076", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/complex_precedence.json.go.golden b/tests/golden/testdata/complex_precedence.json.go.golden new file mode 100644 index 0000000..a48d477 --- /dev/null +++ b/tests/golden/testdata/complex_precedence.json.go.golden @@ -0,0 +1,476 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/complex_precedence.json.golden b/tests/golden/testdata/complex_precedence.json.python.golden similarity index 99% rename from tests/golden/testdata/complex_precedence.json.golden rename to tests/golden/testdata/complex_precedence.json.python.golden index c9f3397..eaeb883 100644 --- a/tests/golden/testdata/complex_precedence.json.golden +++ b/tests/golden/testdata/complex_precedence.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/complex_precedence.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output999487419", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/custom_data.json.go.golden b/tests/golden/testdata/custom_data.json.go.golden new file mode 100644 index 0000000..2efe46d --- /dev/null +++ b/tests/golden/testdata/custom_data.json.go.golden @@ -0,0 +1,258 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/custom_data.json.golden b/tests/golden/testdata/custom_data.json.python.golden similarity index 98% rename from tests/golden/testdata/custom_data.json.golden rename to tests/golden/testdata/custom_data.json.python.golden index 6cecc5a..23c69a1 100644 --- a/tests/golden/testdata/custom_data.json.golden +++ b/tests/golden/testdata/custom_data.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/custom_data.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output588740517", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/defaults.json.go.golden b/tests/golden/testdata/defaults.json.go.golden new file mode 100644 index 0000000..50968d8 --- /dev/null +++ b/tests/golden/testdata/defaults.json.go.golden @@ -0,0 +1,422 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/defaults.json.golden b/tests/golden/testdata/defaults.json.python.golden similarity index 99% rename from tests/golden/testdata/defaults.json.golden rename to tests/golden/testdata/defaults.json.python.golden index 608a735..39c2397 100644 --- a/tests/golden/testdata/defaults.json.golden +++ b/tests/golden/testdata/defaults.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/defaults.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2507816763", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/direct_precedence.json.go.golden b/tests/golden/testdata/direct_precedence.json.go.golden new file mode 100644 index 0000000..e4710d4 --- /dev/null +++ b/tests/golden/testdata/direct_precedence.json.go.golden @@ -0,0 +1,219 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/direct_precedence.json.golden b/tests/golden/testdata/direct_precedence.json.python.golden similarity index 98% rename from tests/golden/testdata/direct_precedence.json.golden rename to tests/golden/testdata/direct_precedence.json.python.golden index 8a33d0c..b6c5ce2 100644 --- a/tests/golden/testdata/direct_precedence.json.golden +++ b/tests/golden/testdata/direct_precedence.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/direct_precedence.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3811773400", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/direct_precedence_linked.json.go.golden b/tests/golden/testdata/direct_precedence_linked.json.go.golden new file mode 100644 index 0000000..3747766 --- /dev/null +++ b/tests/golden/testdata/direct_precedence_linked.json.go.golden @@ -0,0 +1,219 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/direct_precedence_linked.json.golden b/tests/golden/testdata/direct_precedence_linked.json.python.golden similarity index 97% rename from tests/golden/testdata/direct_precedence_linked.json.golden rename to tests/golden/testdata/direct_precedence_linked.json.python.golden index 8e1f4f5..0cd8e1e 100644 --- a/tests/golden/testdata/direct_precedence_linked.json.golden +++ b/tests/golden/testdata/direct_precedence_linked.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/direct_precedence_linked.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3379117588", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/distance_matrix.json.go.golden b/tests/golden/testdata/distance_matrix.json.go.golden new file mode 100644 index 0000000..02f975b --- /dev/null +++ b/tests/golden/testdata/distance_matrix.json.go.golden @@ -0,0 +1,172 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/distance_matrix.json.golden b/tests/golden/testdata/distance_matrix.json.python.golden similarity index 97% rename from tests/golden/testdata/distance_matrix.json.golden rename to tests/golden/testdata/distance_matrix.json.python.golden index a8e4ca7..d2fd687 100644 --- a/tests/golden/testdata/distance_matrix.json.golden +++ b/tests/golden/testdata/distance_matrix.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/distance_matrix.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output4055024084", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_groups.json.go.golden b/tests/golden/testdata/duration_groups.json.go.golden new file mode 100644 index 0000000..269a52d --- /dev/null +++ b/tests/golden/testdata/duration_groups.json.go.golden @@ -0,0 +1,234 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_groups.json.golden b/tests/golden/testdata/duration_groups.json.python.golden similarity index 98% rename from tests/golden/testdata/duration_groups.json.golden rename to tests/golden/testdata/duration_groups.json.python.golden index 7d51f12..ada7619 100644 --- a/tests/golden/testdata/duration_groups.json.golden +++ b/tests/golden/testdata/duration_groups.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_groups.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1259747378", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden new file mode 100644 index 0000000..f952ea9 --- /dev/null +++ b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.go.golden @@ -0,0 +1,234 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.python.golden similarity index 97% rename from tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden rename to tests/golden/testdata/duration_groups_with_stop_multiplier.json.python.golden index 2207dcf..fa54b2c 100644 --- a/tests/golden/testdata/duration_groups_with_stop_multiplier.json.golden +++ b/tests/golden/testdata/duration_groups_with_stop_multiplier.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_groups_with_stop_multiplier.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3273145035", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_matrix.json.go.golden b/tests/golden/testdata/duration_matrix.json.go.golden new file mode 100644 index 0000000..2f66fac --- /dev/null +++ b/tests/golden/testdata/duration_matrix.json.go.golden @@ -0,0 +1,167 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_matrix.json.golden b/tests/golden/testdata/duration_matrix.json.python.golden similarity index 97% rename from tests/golden/testdata/duration_matrix.json.golden rename to tests/golden/testdata/duration_matrix.json.python.golden index 2bd131e..46f221e 100644 --- a/tests/golden/testdata/duration_matrix.json.golden +++ b/tests/golden/testdata/duration_matrix.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_matrix.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output303902732", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden b/tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden new file mode 100644 index 0000000..c3a5c60 --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent0.json.go.golden @@ -0,0 +1,176 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent0.json.golden b/tests/golden/testdata/duration_matrix_time_dependent0.json.python.golden similarity index 97% rename from tests/golden/testdata/duration_matrix_time_dependent0.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent0.json.python.golden index 116cfc9..1a49122 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent0.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent0.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_matrix_time_dependent0.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output366373198", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden b/tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden new file mode 100644 index 0000000..4539daf --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent1.json.go.golden @@ -0,0 +1,176 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent1.json.golden b/tests/golden/testdata/duration_matrix_time_dependent1.json.python.golden similarity index 97% rename from tests/golden/testdata/duration_matrix_time_dependent1.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent1.json.python.golden index b4bf10e..a9e2628 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent1.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent1.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_matrix_time_dependent1.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1204136202", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden b/tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden new file mode 100644 index 0000000..d6ecc4c --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent2.json.go.golden @@ -0,0 +1,176 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent2.json.golden b/tests/golden/testdata/duration_matrix_time_dependent2.json.python.golden similarity index 97% rename from tests/golden/testdata/duration_matrix_time_dependent2.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent2.json.python.golden index 964cd49..f936e14 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent2.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent2.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_matrix_time_dependent2.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2952080814", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden b/tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden new file mode 100644 index 0000000..18ef55e --- /dev/null +++ b/tests/golden/testdata/duration_matrix_time_dependent3.json.go.golden @@ -0,0 +1,181 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/duration_matrix_time_dependent3.json.golden b/tests/golden/testdata/duration_matrix_time_dependent3.json.python.golden similarity index 97% rename from tests/golden/testdata/duration_matrix_time_dependent3.json.golden rename to tests/golden/testdata/duration_matrix_time_dependent3.json.python.golden index 9961064..29f42b5 100644 --- a/tests/golden/testdata/duration_matrix_time_dependent3.json.golden +++ b/tests/golden/testdata/duration_matrix_time_dependent3.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/duration_matrix_time_dependent3.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2913538799", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/early_arrival_penalty.json.go.golden b/tests/golden/testdata/early_arrival_penalty.json.go.golden new file mode 100644 index 0000000..3a3ab05 --- /dev/null +++ b/tests/golden/testdata/early_arrival_penalty.json.go.golden @@ -0,0 +1,261 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/early_arrival_penalty.json.golden b/tests/golden/testdata/early_arrival_penalty.json.python.golden similarity index 98% rename from tests/golden/testdata/early_arrival_penalty.json.golden rename to tests/golden/testdata/early_arrival_penalty.json.python.golden index 7df83a1..1642ebb 100644 --- a/tests/golden/testdata/early_arrival_penalty.json.golden +++ b/tests/golden/testdata/early_arrival_penalty.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/early_arrival_penalty.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2193039604", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/initial_stops.json.go.golden b/tests/golden/testdata/initial_stops.json.go.golden new file mode 100644 index 0000000..b044b08 --- /dev/null +++ b/tests/golden/testdata/initial_stops.json.go.golden @@ -0,0 +1,247 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/initial_stops.json.golden b/tests/golden/testdata/initial_stops.json.python.golden similarity index 98% rename from tests/golden/testdata/initial_stops.json.golden rename to tests/golden/testdata/initial_stops.json.python.golden index 00c3412..f6f584e 100644 --- a/tests/golden/testdata/initial_stops.json.golden +++ b/tests/golden/testdata/initial_stops.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/initial_stops.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3880421598", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden new file mode 100644 index 0000000..c460be4 --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.go.golden @@ -0,0 +1,242 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.python.golden similarity index 97% rename from tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden rename to tests/golden/testdata/initial_stops_infeasible_compatibility.json.python.golden index f9c4185..776ea40 100644 --- a/tests/golden/testdata/initial_stops_infeasible_compatibility.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_compatibility.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/initial_stops_infeasible_compatibility.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output4076025289", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden new file mode 100644 index 0000000..d3f0d83 --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.go.golden @@ -0,0 +1,212 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.python.golden similarity index 97% rename from tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden rename to tests/golden/testdata/initial_stops_infeasible_max_duration.json.python.golden index de2a203..279b8fb 100644 --- a/tests/golden/testdata/initial_stops_infeasible_max_duration.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_max_duration.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/initial_stops_infeasible_max_duration.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output852865789", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden new file mode 100644 index 0000000..aa6747b --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.go.golden @@ -0,0 +1,150 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.python.golden similarity index 96% rename from tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden rename to tests/golden/testdata/initial_stops_infeasible_remove_all.json.python.golden index e352a06..3e5e4f5 100644 --- a/tests/golden/testdata/initial_stops_infeasible_remove_all.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_remove_all.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/initial_stops_infeasible_remove_all.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2809169781", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden b/tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden new file mode 100644 index 0000000..071d85c --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_temporal.json.go.golden @@ -0,0 +1,238 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden b/tests/golden/testdata/initial_stops_infeasible_temporal.json.python.golden similarity index 98% rename from tests/golden/testdata/initial_stops_infeasible_temporal.json.golden rename to tests/golden/testdata/initial_stops_infeasible_temporal.json.python.golden index 2aa6895..816d59b 100644 --- a/tests/golden/testdata/initial_stops_infeasible_temporal.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_temporal.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/initial_stops_infeasible_temporal.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output214934900", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden b/tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden new file mode 100644 index 0000000..fe2bf7b --- /dev/null +++ b/tests/golden/testdata/initial_stops_infeasible_tuple.json.go.golden @@ -0,0 +1,192 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden b/tests/golden/testdata/initial_stops_infeasible_tuple.json.python.golden similarity index 97% rename from tests/golden/testdata/initial_stops_infeasible_tuple.json.golden rename to tests/golden/testdata/initial_stops_infeasible_tuple.json.python.golden index 6cc9d72..a3fa46e 100644 --- a/tests/golden/testdata/initial_stops_infeasible_tuple.json.golden +++ b/tests/golden/testdata/initial_stops_infeasible_tuple.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/initial_stops_infeasible_tuple.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1073475082", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/late_arrival_penalty.json.go.golden b/tests/golden/testdata/late_arrival_penalty.json.go.golden new file mode 100644 index 0000000..af4e58b --- /dev/null +++ b/tests/golden/testdata/late_arrival_penalty.json.go.golden @@ -0,0 +1,271 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/late_arrival_penalty.json.golden b/tests/golden/testdata/late_arrival_penalty.json.python.golden similarity index 98% rename from tests/golden/testdata/late_arrival_penalty.json.golden rename to tests/golden/testdata/late_arrival_penalty.json.python.golden index 7fcacd5..4be5abf 100644 --- a/tests/golden/testdata/late_arrival_penalty.json.golden +++ b/tests/golden/testdata/late_arrival_penalty.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/late_arrival_penalty.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3315937452", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/max_distance.json.go.golden b/tests/golden/testdata/max_distance.json.go.golden new file mode 100644 index 0000000..beba902 --- /dev/null +++ b/tests/golden/testdata/max_distance.json.go.golden @@ -0,0 +1,209 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/max_distance.json.golden b/tests/golden/testdata/max_distance.json.python.golden similarity index 97% rename from tests/golden/testdata/max_distance.json.golden rename to tests/golden/testdata/max_distance.json.python.golden index ec7deb9..1c417bf 100644 --- a/tests/golden/testdata/max_distance.json.golden +++ b/tests/golden/testdata/max_distance.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/max_distance.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1834584023", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/max_duration.json.go.golden b/tests/golden/testdata/max_duration.json.go.golden new file mode 100644 index 0000000..558c54b --- /dev/null +++ b/tests/golden/testdata/max_duration.json.go.golden @@ -0,0 +1,237 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/max_duration.json.golden b/tests/golden/testdata/max_duration.json.python.golden similarity index 98% rename from tests/golden/testdata/max_duration.json.golden rename to tests/golden/testdata/max_duration.json.python.golden index 29542a7..1d18a93 100644 --- a/tests/golden/testdata/max_duration.json.golden +++ b/tests/golden/testdata/max_duration.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/max_duration.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1707282943", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/max_stops.json.go.golden b/tests/golden/testdata/max_stops.json.go.golden new file mode 100644 index 0000000..33f4a3e --- /dev/null +++ b/tests/golden/testdata/max_stops.json.go.golden @@ -0,0 +1,215 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/max_stops.json.golden b/tests/golden/testdata/max_stops.json.python.golden similarity index 98% rename from tests/golden/testdata/max_stops.json.golden rename to tests/golden/testdata/max_stops.json.python.golden index f79c6c2..4a6bb7f 100644 --- a/tests/golden/testdata/max_stops.json.golden +++ b/tests/golden/testdata/max_stops.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/max_stops.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output682963753", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/max_wait_stop.json.go.golden b/tests/golden/testdata/max_wait_stop.json.go.golden new file mode 100644 index 0000000..42159b3 --- /dev/null +++ b/tests/golden/testdata/max_wait_stop.json.go.golden @@ -0,0 +1,178 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/max_wait_stop.json.golden b/tests/golden/testdata/max_wait_stop.json.python.golden similarity index 97% rename from tests/golden/testdata/max_wait_stop.json.golden rename to tests/golden/testdata/max_wait_stop.json.python.golden index 6c65621..dd87de2 100644 --- a/tests/golden/testdata/max_wait_stop.json.golden +++ b/tests/golden/testdata/max_wait_stop.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/max_wait_stop.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output281284137", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/max_wait_vehicle.json.go.golden b/tests/golden/testdata/max_wait_vehicle.json.go.golden new file mode 100644 index 0000000..ce8a928 --- /dev/null +++ b/tests/golden/testdata/max_wait_vehicle.json.go.golden @@ -0,0 +1,230 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/max_wait_vehicle.json.golden b/tests/golden/testdata/max_wait_vehicle.json.python.golden similarity index 98% rename from tests/golden/testdata/max_wait_vehicle.json.golden rename to tests/golden/testdata/max_wait_vehicle.json.python.golden index 0ac297f..32da637 100644 --- a/tests/golden/testdata/max_wait_vehicle.json.golden +++ b/tests/golden/testdata/max_wait_vehicle.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/max_wait_vehicle.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1467601539", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/min_stops.json.go.golden b/tests/golden/testdata/min_stops.json.go.golden new file mode 100644 index 0000000..8af7f37 --- /dev/null +++ b/tests/golden/testdata/min_stops.json.go.golden @@ -0,0 +1,230 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/min_stops.json.golden b/tests/golden/testdata/min_stops.json.python.golden similarity index 98% rename from tests/golden/testdata/min_stops.json.golden rename to tests/golden/testdata/min_stops.json.python.golden index a9e3c25..8dc177c 100644 --- a/tests/golden/testdata/min_stops.json.golden +++ b/tests/golden/testdata/min_stops.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/min_stops.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output361931986", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/multi_window.json.go.golden b/tests/golden/testdata/multi_window.json.go.golden new file mode 100644 index 0000000..0076b29 --- /dev/null +++ b/tests/golden/testdata/multi_window.json.go.golden @@ -0,0 +1,177 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/multi_window.json.golden b/tests/golden/testdata/multi_window.json.python.golden similarity index 97% rename from tests/golden/testdata/multi_window.json.golden rename to tests/golden/testdata/multi_window.json.python.golden index 95d5ef1..7c55df2 100644 --- a/tests/golden/testdata/multi_window.json.golden +++ b/tests/golden/testdata/multi_window.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/multi_window.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3359428556", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/no_mix.json.go.golden b/tests/golden/testdata/no_mix.json.go.golden new file mode 100644 index 0000000..8d8d344 --- /dev/null +++ b/tests/golden/testdata/no_mix.json.go.golden @@ -0,0 +1,261 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/no_mix.json.golden b/tests/golden/testdata/no_mix.json.python.golden similarity index 98% rename from tests/golden/testdata/no_mix.json.golden rename to tests/golden/testdata/no_mix.json.python.golden index 71741e6..74c1544 100644 --- a/tests/golden/testdata/no_mix.json.golden +++ b/tests/golden/testdata/no_mix.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/no_mix.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output4235708350", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/no_mix_null.json.go.golden b/tests/golden/testdata/no_mix_null.json.go.golden new file mode 100644 index 0000000..d185935 --- /dev/null +++ b/tests/golden/testdata/no_mix_null.json.go.golden @@ -0,0 +1,280 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/no_mix_null.json.golden b/tests/golden/testdata/no_mix_null.json.python.golden similarity index 98% rename from tests/golden/testdata/no_mix_null.json.golden rename to tests/golden/testdata/no_mix_null.json.python.golden index 92be301..9bad82b 100644 --- a/tests/golden/testdata/no_mix_null.json.golden +++ b/tests/golden/testdata/no_mix_null.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/no_mix_null.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3471793865", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/precedence.json.go.golden b/tests/golden/testdata/precedence.json.go.golden new file mode 100644 index 0000000..19a69a5 --- /dev/null +++ b/tests/golden/testdata/precedence.json.go.golden @@ -0,0 +1,219 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/precedence.json.golden b/tests/golden/testdata/precedence.json.python.golden similarity index 98% rename from tests/golden/testdata/precedence.json.golden rename to tests/golden/testdata/precedence.json.python.golden index a265bb0..2c11379 100644 --- a/tests/golden/testdata/precedence.json.golden +++ b/tests/golden/testdata/precedence.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/precedence.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output440828888", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/precedence_pathologic.json.go.golden b/tests/golden/testdata/precedence_pathologic.json.go.golden new file mode 100644 index 0000000..c0c8ccb --- /dev/null +++ b/tests/golden/testdata/precedence_pathologic.json.go.golden @@ -0,0 +1,294 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/precedence_pathologic.json.golden b/tests/golden/testdata/precedence_pathologic.json.python.golden similarity index 98% rename from tests/golden/testdata/precedence_pathologic.json.golden rename to tests/golden/testdata/precedence_pathologic.json.python.golden index 35ce5a9..86aa54b 100644 --- a/tests/golden/testdata/precedence_pathologic.json.golden +++ b/tests/golden/testdata/precedence_pathologic.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/precedence_pathologic.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1300265168", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/start_level.json.go.golden b/tests/golden/testdata/start_level.json.go.golden new file mode 100644 index 0000000..69f25a1 --- /dev/null +++ b/tests/golden/testdata/start_level.json.go.golden @@ -0,0 +1,232 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/start_level.json.golden b/tests/golden/testdata/start_level.json.python.golden similarity index 98% rename from tests/golden/testdata/start_level.json.golden rename to tests/golden/testdata/start_level.json.python.golden index 0720d3d..d1e8478 100644 --- a/tests/golden/testdata/start_level.json.golden +++ b/tests/golden/testdata/start_level.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/start_level.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1293967379", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/start_time_window.json.go.golden b/tests/golden/testdata/start_time_window.json.go.golden new file mode 100644 index 0000000..7a7eeeb --- /dev/null +++ b/tests/golden/testdata/start_time_window.json.go.golden @@ -0,0 +1,260 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/start_time_window.json.golden b/tests/golden/testdata/start_time_window.json.python.golden similarity index 98% rename from tests/golden/testdata/start_time_window.json.golden rename to tests/golden/testdata/start_time_window.json.python.golden index 8cb47d7..6c49b93 100644 --- a/tests/golden/testdata/start_time_window.json.golden +++ b/tests/golden/testdata/start_time_window.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/start_time_window.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output1078290645", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/stop_duration.json.go.golden b/tests/golden/testdata/stop_duration.json.go.golden new file mode 100644 index 0000000..7325b8d --- /dev/null +++ b/tests/golden/testdata/stop_duration.json.go.golden @@ -0,0 +1,259 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/stop_duration.json.golden b/tests/golden/testdata/stop_duration.json.python.golden similarity index 98% rename from tests/golden/testdata/stop_duration.json.golden rename to tests/golden/testdata/stop_duration.json.python.golden index 709f8b5..0cccff0 100644 --- a/tests/golden/testdata/stop_duration.json.golden +++ b/tests/golden/testdata/stop_duration.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/stop_duration.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output663794806", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/stop_duration_multiplier.json.go.golden b/tests/golden/testdata/stop_duration_multiplier.json.go.golden new file mode 100644 index 0000000..69cc789 --- /dev/null +++ b/tests/golden/testdata/stop_duration_multiplier.json.go.golden @@ -0,0 +1,259 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/stop_duration_multiplier.json.golden b/tests/golden/testdata/stop_duration_multiplier.json.python.golden similarity index 98% rename from tests/golden/testdata/stop_duration_multiplier.json.golden rename to tests/golden/testdata/stop_duration_multiplier.json.python.golden index 5ee434b..852beff 100644 --- a/tests/golden/testdata/stop_duration_multiplier.json.golden +++ b/tests/golden/testdata/stop_duration_multiplier.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/stop_duration_multiplier.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2557505674", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/stop_groups.json.go.golden b/tests/golden/testdata/stop_groups.json.go.golden new file mode 100644 index 0000000..d46f51f --- /dev/null +++ b/tests/golden/testdata/stop_groups.json.go.golden @@ -0,0 +1,264 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/stop_groups.json.golden b/tests/golden/testdata/stop_groups.json.python.golden similarity index 98% rename from tests/golden/testdata/stop_groups.json.golden rename to tests/golden/testdata/stop_groups.json.python.golden index c351188..383d50d 100644 --- a/tests/golden/testdata/stop_groups.json.golden +++ b/tests/golden/testdata/stop_groups.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/stop_groups.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3267850648", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/template_input.json.go.golden b/tests/golden/testdata/template_input.json.go.golden new file mode 100644 index 0000000..64558a9 --- /dev/null +++ b/tests/golden/testdata/template_input.json.go.golden @@ -0,0 +1,629 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/template_input.json.golden b/tests/golden/testdata/template_input.json.python.golden similarity index 99% rename from tests/golden/testdata/template_input.json.golden rename to tests/golden/testdata/template_input.json.python.golden index be9ab08..fb77914 100644 --- a/tests/golden/testdata/template_input.json.golden +++ b/tests/golden/testdata/template_input.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/template_input.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output2963297136", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/unplanned_penalty.json.go.golden b/tests/golden/testdata/unplanned_penalty.json.go.golden new file mode 100644 index 0000000..3e92d01 --- /dev/null +++ b/tests/golden/testdata/unplanned_penalty.json.go.golden @@ -0,0 +1,208 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/unplanned_penalty.json.golden b/tests/golden/testdata/unplanned_penalty.json.python.golden similarity index 97% rename from tests/golden/testdata/unplanned_penalty.json.golden rename to tests/golden/testdata/unplanned_penalty.json.python.golden index 0810796..004229c 100644 --- a/tests/golden/testdata/unplanned_penalty.json.golden +++ b/tests/golden/testdata/unplanned_penalty.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/unplanned_penalty.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3099972039", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/vehicle_start_end_location.json.go.golden b/tests/golden/testdata/vehicle_start_end_location.json.go.golden new file mode 100644 index 0000000..2c3b323 --- /dev/null +++ b/tests/golden/testdata/vehicle_start_end_location.json.go.golden @@ -0,0 +1,271 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/vehicle_start_end_location.json.golden b/tests/golden/testdata/vehicle_start_end_location.json.python.golden similarity index 98% rename from tests/golden/testdata/vehicle_start_end_location.json.golden rename to tests/golden/testdata/vehicle_start_end_location.json.python.golden index 42933cf..b5f80f0 100644 --- a/tests/golden/testdata/vehicle_start_end_location.json.golden +++ b/tests/golden/testdata/vehicle_start_end_location.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/vehicle_start_end_location.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3291492182", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/vehicle_start_end_time.json.go.golden b/tests/golden/testdata/vehicle_start_end_time.json.go.golden new file mode 100644 index 0000000..7c57aa6 --- /dev/null +++ b/tests/golden/testdata/vehicle_start_end_time.json.go.golden @@ -0,0 +1,319 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/vehicle_start_end_time.json.golden b/tests/golden/testdata/vehicle_start_end_time.json.python.golden similarity index 98% rename from tests/golden/testdata/vehicle_start_end_time.json.golden rename to tests/golden/testdata/vehicle_start_end_time.json.python.golden index 5bccde6..3f8e72e 100644 --- a/tests/golden/testdata/vehicle_start_end_time.json.golden +++ b/tests/golden/testdata/vehicle_start_end_time.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/vehicle_start_end_time.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output619893251", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, diff --git a/tests/golden/testdata/vehicles_duration_objective.json.go.golden b/tests/golden/testdata/vehicles_duration_objective.json.go.golden new file mode 100644 index 0000000..330a2cc --- /dev/null +++ b/tests/golden/testdata/vehicles_duration_objective.json.go.golden @@ -0,0 +1,181 @@ +{ + "options": { + "check": { + "duration": 30000000000, + "verbosity": "off" + }, + "format": { + "disable": { + "progression": true + } + }, + "model": { + "constraints": { + "disable": { + "attributes": false, + "capacities": null, + "capacity": false, + "distance_limit": false, + "groups": false, + "maximum_duration": false, + "maximum_stops": false, + "maximum_wait_stop": false, + "maximum_wait_vehicle": false, + "mixing_items": false, + "precedence": false, + "start_time_windows": false, + "vehicle_end_time": false, + "vehicle_start_time": false + }, + "enable": { + "cluster": false + } + }, + "objectives": { + "capacities": "", + "cluster": 0, + "early_arrival_penalty": 1, + "late_arrival_penalty": 1, + "min_stops": 1, + "stop_balance": 0, + "travel_duration": 0, + "unplanned_penalty": 1, + "vehicle_activation_penalty": 1, + "vehicles_duration": 1 + }, + "properties": { + "disable": { + "duration_groups": false, + "durations": false, + "initial_solution": false, + "stop_duration_multipliers": false + }, + "maximum_time_horizon": 15552000 + }, + "validate": { + "disable": { + "resources": false, + "start_time": false + }, + "enable": { + "matrix": false, + "matrix_asymmetry_tolerance": 20 + } + } + }, + "solve": { + "duration": 10000000000, + "iterations": 50, + "parallel_runs": 1, + "run_deterministically": true, + "start_solutions": 1 + } + }, + "solutions": [ + { + "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" + }, + "version": { + "sdk": "VERSION" + } +} diff --git a/tests/golden/testdata/vehicles_duration_objective.json.golden b/tests/golden/testdata/vehicles_duration_objective.json.python.golden similarity index 97% rename from tests/golden/testdata/vehicles_duration_objective.json.golden rename to tests/golden/testdata/vehicles_duration_objective.json.python.golden index 044f94d..987091f 100644 --- a/tests/golden/testdata/vehicles_duration_objective.json.golden +++ b/tests/golden/testdata/vehicles_duration_objective.json.python.golden @@ -3,7 +3,7 @@ "check_duration": 30, "check_verbosity": "off", "format_disable_progression": true, - "input": "../../../tests/golden/testdata/vehicles_duration_objective.json", + "input": "input.json", "model_constraints_disable_attributes": false, "model_constraints_disable_capacities": [], "model_constraints_disable_capacity": false, @@ -36,7 +36,7 @@ "model_validate_disable_starttime": false, "model_validate_enable_matrix": false, "model_validate_enable_matrixasymmetrytolerance": 20, - "output": "/tmp/output3854531625", + "output": "output.json", "solve_duration": 10, "solve_iterations": 50, "solve_parallelruns": 1, 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": { From 6d218847e33a6e403caf75381322ddde61087f3a Mon Sep 17 00:00:00 2001 From: Marius Merschformann Date: Mon, 16 Dec 2024 13:35:53 +0100 Subject: [PATCH 5/5] Using official sdk release --- go.mod | 2 +- go.sum | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 5cd9453..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.2-0.20241216100747-7da66dbefd1c + github.com/nextmv-io/sdk v1.8.2 gonum.org/v1/gonum v0.14.0 ) diff --git a/go.sum b/go.sum index f1b6527..ea77de9 100644 --- a/go.sum +++ b/go.sum @@ -301,10 +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-0.20241216100747-7da66dbefd1c h1:Tm248WPtjW1Fo9BO2FNIwVuroKasmORfgQq0DtLFbbE= -github.com/nextmv-io/sdk v1.8.2-0.20241216100747-7da66dbefd1c/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=