If both an environment variable and its corresponding CLI flag are defined, the CLI flag will overwrite the environment variable.
These are the default options that are available with vehicle routing.
Nextmv Hybrid Optimization Platform Usage: -check.duration duration maximum duration of the check (env CHECK_DURATION) (default 30s) -check.verbosity string {off, low, medium, high} verbosity of the check (env CHECK_VERBOSITY) (default "off") -format.disable.progression disable the progression series (env FORMAT_DISABLE_PROGRESSION) -model.constraints.disable.attributes ignore the compatibility attributes constraint (env MODEL_CONSTRAINTS_DISABLE_ATTRIBUTES) -model.constraints.disable.capacities value ignore the capacity constraint for the given resource names (env MODEL_CONSTRAINTS_DISABLE_CAPACITIES) -model.constraints.disable.capacity ignore the capacity constraint for all resources (env MODEL_CONSTRAINTS_DISABLE_CAPACITY) -model.constraints.disable.distancelimit ignore the distance limit constraint (env MODEL_CONSTRAINTS_DISABLE_DISTANCE_LIMIT) -model.constraints.disable.groups ignore the groups constraint (env MODEL_CONSTRAINTS_DISABLE_GROUPS) -model.constraints.disable.maximumduration ignore the maximum duration constraint (env MODEL_CONSTRAINTS_DISABLE_MAXIMUM_DURATION) -model.constraints.disable.maximumstops ignore the maximum stops constraint (env MODEL_CONSTRAINTS_DISABLE_MAXIMUM_STOPS) -model.constraints.disable.maximumwaitstop ignore the maximum stop wait constraint (env MODEL_CONSTRAINTS_DISABLE_MAXIMUM_WAIT_STOP) -model.constraints.disable.maximumwaitvehicle ignore the maximum vehicle wait constraint (env MODEL_CONSTRAINTS_DISABLE_MAXIMUM_WAIT_VEHICLE) -model.constraints.disable.mixingitems ignore the do not mix items constraint (env MODEL_CONSTRAINTS_DISABLE_MIXING_ITEMS) -model.constraints.disable.precedence ignore the precedence (pickups & deliveries) constraint (env MODEL_CONSTRAINTS_DISABLE_PRECEDENCE) -model.constraints.disable.starttimewindows ignore the start time windows constraint (env MODEL_CONSTRAINTS_DISABLE_START_TIME_WINDOWS) -model.constraints.disable.vehicleendtime ignore the vehicle end time constraint (env MODEL_CONSTRAINTS_DISABLE_VEHICLE_END_TIME) -model.constraints.disable.vehiclestarttime ignore the vehicle start time constraint (env MODEL_CONSTRAINTS_DISABLE_VEHICLE_START_TIME) -model.constraints.enable.cluster enable the cluster constraint (env MODEL_CONSTRAINTS_ENABLE_CLUSTER) -model.objectives.capacities string capacity objective, provide triple for each resource 'name:default;factor:1.0;offset;0.0' (env MODEL_OBJECTIVES_CAPACITIES) -model.objectives.cluster float factor to weigh the cluster objective (env MODEL_OBJECTIVES_CLUSTER) -model.objectives.earlyarrivalpenalty float factor to weigh the early arrival objective (env MODEL_OBJECTIVES_EARLY_ARRIVAL_PENALTY) (default 1) -model.objectives.latearrivalpenalty float factor to weigh the late arrival objective (env MODEL_OBJECTIVES_LATE_ARRIVAL_PENALTY) (default 1) -model.objectives.minstops float factor to weigh the min stops objective (env MODEL_OBJECTIVES_MIN_STOPS) (default 1) -model.objectives.travelduration float factor to weigh the travel duration objective (env MODEL_OBJECTIVES_TRAVEL_DURATION) -model.objectives.unplannedpenalty float factor to weigh the unplanned objective (env MODEL_OBJECTIVES_UNPLANNED_PENALTY) (default 1) -model.objectives.vehicleactivationpenalty float factor to weigh the vehicle activation objective (env MODEL_OBJECTIVES_VEHICLE_ACTIVATION_PENALTY) (default 1) -model.objectives.vehiclesduration float factor to weigh the vehicles duration objective (env MODEL_OBJECTIVES_VEHICLES_DURATION) (default 1) -model.properties.disable.durationgroups ignore the durations groups of stops (env MODEL_PROPERTIES_DISABLE_DURATION_GROUPS) -model.properties.disable.durations ignore the durations of stops (env MODEL_PROPERTIES_DISABLE_DURATIONS) -model.properties.disable.initialsolution ignore the initial solution (env MODEL_PROPERTIES_DISABLE_INITIAL_SOLUTION) -model.properties.disable.stopdurationmultipliers ignore the stop duration multipliers defined on vehicles (env MODEL_PROPERTIES_DISABLE_STOP_DURATION_MULTIPLIERS) -model.validate.disable.resources disable the resources validation (env MODEL_VALIDATE_DISABLE_RESOURCES) -model.validate.disable.starttime disable the start time validation (env MODEL_VALIDATE_DISABLE_START_TIME) -model.validate.enable.matrix enable matrix validation (env MODEL_VALIDATE_ENABLE_MATRIX) -model.validate.enable.matrixasymmetrytolerance int percentage of acceptable matrix asymmetry, requires matrix validation enabled (env MODEL_VALIDATE_ENABLE_MATRIX_ASYMMETRY_TOLERANCE) (default 20) -runner.input.path string The input file path (env RUNNER_INPUT_PATH) -runner.output.path string The output file path (env RUNNER_OUTPUT_PATH) -runner.output.solutions string {all, last} (env RUNNER_OUTPUT_SOLUTIONS) (default "last") -runner.profile.cpu string The CPU profile file path (env RUNNER_PROFILE_CPU) -runner.profile.memory string The memory profile file path (env RUNNER_PROFILE_MEMORY) -solve.duration duration maximum duration of the solver (env SOLVE_DURATION) (default 5s) -solve.iterations int maximum number of iterations, -1 assumes no limit; iterations are counted after start solutions are generated (env SOLVE_ITERATIONS) (default -1) -solve.parallelruns int maximum number of parallel runs, -1 results in using all available resources (env SOLVE_PARALLEL_RUNS) (default -1) -solve.rundeterministically run the parallel solver deterministically (env SOLVE_RUN_DETERMINISTICALLY) -solve.startsolutions int number of solutions to generate on top of those passed in; one solution generated with sweep algorithm, the rest generated randomly (env SOLVE_START_SOLUTIONS) (default -1)
Valid time units for -solve.duration
are as follows, according to time.ParseDuration
from Go's standard library:
ns
(nanoseconds)us/µs
(microseconds)ms
(milliseconds)s
(seconds)m
(minutes)h
(hours)
The solve duration is displayed in ns
in the output.
The options are marshalled to the output when running an app, under the options
key. Here is an example of how the options are displayed.
{ "model": { "constraints": { "disable": { "attributes": false, "capacity": false, "capacities": null, "distance_limit": false, "groups": false, "maximum_duration": false, "maximum_stops": false, "maximum_wait_stop": false, "maximum_wait_vehicle": false, "mixing_items": false, "precedence": false, "vehicle_start_time": false, "vehicle_end_time": false, "start_time_windows": false }, "enable": { "cluster": false } }, "objectives": { "capacities": "", "min_stops": 1, "early_arrival_penalty": 1, "late_arrival_penalty": 1, "vehicle_activation_penalty": 1, "travel_duration": 0, "vehicles_duration": 1, "unplanned_penalty": 1, "cluster": 0 }, "properties": { "disable": { "durations": false, "stop_duration_multipliers": false, "duration_groups": false, "initial_solution": false } }, "validate": { "disable": { "start_time": false, "resources": false }, "enable": { "matrix": false, "matrix_asymmetry_tolerance": 20 } } }, "solve": { "iterations": 50, "duration": 10000000000, "parallel_runs": 1, "start_solutions": 1, "run_deterministically": true }, "format": { "disable": { "progression": true } }, "check": { "duration": 30000000000, "verbosity": "off" } }
When working with platform, you may also modify the options in code, which would override the ones passed from the runner. Here is an example of how this is done and how the resulting output shows the modified options. Notice that options
is modified multiple times inside the solver
function.
{ "options": { "check": { "duration": 30000000000, "verbosity": "off" }, "format": { "disable": { "progression": true } }, "model": { "constraints": { "disable": { "attributes": true, "capacities": null, "capacity": true, "distance_limit": false, "groups": false, "maximum_duration": false, "maximum_stops": false, "maximum_wait_stop": false, "maximum_wait_vehicle": false, "mixing_items": false, "precedence": true, "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, "travel_duration": 0.5, "unplanned_penalty": 0.3, "vehicle_activation_penalty": 1, "vehicles_duration": 1 }, "properties": { "disable": { "duration_groups": false, "durations": false, "initial_solution": false, "stop_duration_multipliers": false } }, "validate": { "disable": { "resources": false, "start_time": false }, "enable": { "matrix": false, "matrix_asymmetry_tolerance": 20 } } }, "solve": { "duration": 11000000000, "iterations": 51, "parallel_runs": 1, "run_deterministically": true, "start_solutions": 1 } }, "solutions": [ { "objective": { "name": "0.5 * travel_duration + 1 * vehicles_duration + 0.3 * unplanned_penalty", "objectives": [ { "base": 909.0466359667602, "factor": 0.5, "name": "travel_duration", "value": 454.5233179833801 }, { "base": 909.0466359667602, "factor": 1, "name": "vehicles_duration", "value": 909.0466359667602 }, { "factor": 0.3, "name": "unplanned_penalty", "value": 0 } ], "value": 1363.5699539501402 }, "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": 909, "max_stops_in_vehicle": 7, "max_travel_duration": 909, "min_duration": 909, "min_stops_in_vehicle": 7, "min_travel_duration": 909, "unplanned_stops": 0 }, "duration": 0.123, "value": 1363.5699539501402 }, "run": { "duration": 0.123, "iterations": 51 }, "schema": "v1" }, "version": { "sdk": "VERSION" } }