Skip to content

Instantly share code, notes, and snippets.

@braktar
Last active March 30, 2020 08:31
Show Gist options
  • Save braktar/c1eeacbf1919f9fa3fe243768888bf9c to your computer and use it in GitHub Desktop.
Save braktar/c1eeacbf1919f9fa3fe243768888bf9c to your computer and use it in GitHub Desktop.
Actual Optimizer API swagger Description
{
"info": {
"title": "Optimizers API",
"description": "\nUnified API for multiple optimizer engines dedicated to Vehicle Routing Problems\n\nIts purpose is to provide a complete chain for the resolution. From a provided VRP, it requires a distance matrix, solve the problem and prepare a self sufficient result.\n\nPlease check the Github Wiki for more details: [https://github.com/Mapotempo/optimizer-api/wiki](https://github.com/Mapotempo/optimizer-api/wiki)\n",
"contact": {
"email": "tech@mapotempo.com",
"url": "https://github.com/Mapotempo/optimizer-api"
},
"license": {
"name": "GNU Affero General Public License 3",
"url": "https://raw.githubusercontent.com/Mapotempo/optimizer-api/master/LICENSE"
},
"version": "0.1.5"
},
"swagger": "2.0",
"produces": [
"application/json; charset=UTF-8",
"application/xml"
],
"securityDefinitions": {
"api_key_query_param": {
"type": "apiKey",
"name": "api_key",
"in": "query"
}
},
"host": "optimizer.mapotempo.com",
"tags": [
{
"name": "vrp",
"description": "Operations about vrps"
}
],
"paths": {
"/0.1/vrp/jobs/{id}": {
"delete": {
"summary": "Delete vrp job",
"description": "Kill the job. This operation may have delay, since if the job is working it will be killed during the next iteration.",
"produces": [
"application/json; charset=UTF-8",
"application/xml"
],
"parameters": [
{
"in": "path",
"name": "id",
"description": "Job id returned by creating VRP problem.",
"type": "string",
"required": true
}
],
"responses": {
"204": {
"description": "Delete vrp job"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/Status"
}
}
},
"tags": [
"vrp"
],
"operationId": "deleteJob"
},
"get": {
"summary": "Fetch vrp job status",
"description": "Get the job status and details, contains progress avancement. Return the best actual solutions currently found.",
"produces": [
"application/json; charset=UTF-8",
"application/xml"
],
"parameters": [
{
"in": "path",
"name": "id",
"description": "Job id returned by creating VRP problem.",
"type": "string",
"required": true
}
],
"security": [
{
"api_key_query_param": []
}
],
"responses": {
"200": {
"description": "Fetch vrp job status",
"schema": {
"$ref": "#/definitions/VrpResult"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/Status"
}
}
},
"tags": [
"vrp"
],
"operationId": "get_job"
}
},
"/0.1/vrp/jobs": {
"get": {
"summary": "List vrp jobs",
"description": "List running or queued jobs.",
"produces": [
"application/json; charset=UTF-8",
"application/xml"
],
"responses": {
"200": {
"description": "List vrp jobs",
"schema": {
"$ref": "#/definitions/VrpJobsList"
}
}
},
"tags": [
"vrp"
],
"operationId": "get_job_list"
}
},
"/0.1/vrp/submit": {
"post": {
"summary": "Submit VRP problem",
"description": "Submit vehicle routing problem. If the problem can be quickly solved, the solution is returned in the response. In other case, the response provides a job identifier in a queue: you need to perfom another request to fetch vrp job status and solution.",
"produces": [
"application/json; charset=UTF-8",
"application/xml"
],
"consumes": [
"application/json"
],
"parameters": [
{
"name": "01VrpSubmit",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/post01VrpSubmit"
}
}
],
"security": [
{
"api_key_query_param": []
}
],
"responses": {
"201": {
"description": "Submit VRP problem",
"schema": {
"$ref": "#/definitions/VrpResult"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/Status"
}
}
},
"tags": [
"vrp"
],
"operationId": "submit_vrp"
}
}
},
"definitions": {
"Status": {
"type": "object",
"properties": {
"status": {
"type": "string",
"description": "Status title."
},
"message": {
"type": "string",
"description": "Status message."
}
},
"description": "Submit vehicle routing problem. If the problem can be quickly solved, the solution is returned in the response. In other case, the response provides a job identifier in a queue: you need to perfom another request to fetch vrp job status and solution."
},
"VrpJobsList": {
"type": "object",
"properties": {
"jobs": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultJob"
},
"description": "The Jobs."
}
},
"description": "List running or queued jobs."
},
"VrpResultJob": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Job uniq ID"
},
"status": {
"type": "string",
"description": "One of queued, working, completed, killed or failed."
},
"avancement": {
"type": "string",
"description": "Free form advancement message."
},
"graph": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultJobGraphItem"
},
"description": "Items to plot cost evolution."
}
}
},
"VrpResultJobGraphItem": {
"type": "object",
"properties": {
"iteration": {
"type": "integer",
"format": "int32",
"description": "Iteration number."
},
"time": {
"type": "integer",
"format": "int32",
"description": "Time in ms since resolution begin."
},
"cost": {
"type": "number",
"format": "float",
"description": "Current best cost at this iteration."
}
}
},
"VrpResult": {
"type": "object",
"properties": {
"solutions": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultSolution"
},
"description": "The current best solution."
},
"job": {
"$ref": "#/definitions/VrpResultJob",
"description": "The Job status."
}
},
"description": "Submit vehicle routing problem. If the problem can be quickly solved, the solution is returned in the response. In other case, the response provides a job identifier in a queue: you need to perfom another request to fetch vrp job status and solution."
},
"VrpResultSolution": {
"type": "object",
"properties": {
"heuristics_synthesis": {
"type": "object",
"description": "When first_solution_strategies are provided, sum up of tryied heuristics and their performance."
},
"solvers": {
"type": "array",
"items": {
"type": "string"
},
"description": "Solvers used to perform the optimization"
},
"cost": {
"type": "number",
"format": "float",
"description": "The actual cost of the solution considering all costs"
},
"iterations": {
"type": "integer",
"format": "int32",
"description": "Total number of iteration performed to obtain the current result"
},
"total_distance": {
"type": "integer",
"format": "int32",
"description": "cumulated distance of every route"
},
"total_time": {
"type": "integer",
"format": "int32",
"description": "Cumulated time of every route"
},
"start_time": {
"type": "integer",
"format": "int32",
"description": ""
},
"end_time": {
"type": "integer",
"format": "int32",
"description": ""
},
"routes": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultSolutionRoute"
},
"description": "All the route calculated"
},
"unassigned": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultSolutionUnassigneds"
},
"description": "Jobs which are not part of the solution"
}
}
},
"VrpResultSolutionRoute": {
"type": "object",
"properties": {
"vehicle_id": {
"type": "string",
"description": "Reference of the vehicule used for the current route"
},
"activities": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultSolutionRouteActivities"
},
"description": "Every step of the route"
},
"total_distance": {
"type": "integer",
"format": "int32",
"description": "Sum of every distance within the route"
},
"total_time": {
"type": "integer",
"format": "int32",
"description": "Sum of every travel time and activity duration of the route"
},
"start_time": {
"type": "integer",
"format": "int32",
"description": "Give the actual start time of the current route if provided by the solve"
},
"end_time": {
"type": "integer",
"format": "int32",
"description": "Give the actual end time of the current route if provided by the solver"
},
"geometry": {
"type": "string",
"description": "Contains the geometry of the route, if asked in first place"
},
"initial_loads": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultDetailQuantities"
},
"description": "Give the actual initial loads of the route"
}
}
},
"VrpResultSolutionRouteActivities": {
"type": "object",
"properties": {
"point_id": {
"type": "string",
"description": "Linked spatial point"
},
"travel_distance": {
"type": "integer",
"format": "int32",
"description": "travel distance from the previous point"
},
"travel_duration": {
"type": "integer",
"format": "int32",
"description": "travel time from the previous point"
},
"waiting_duration": {
"type": "integer",
"format": "int32",
"description": ""
},
"arrival_time": {
"type": "integer",
"format": "int32",
"description": ""
},
"departure_time": {
"type": "integer",
"format": "int32",
"description": ""
},
"service_id": {
"type": "string",
"description": ""
},
"pickup_shipment_id": {
"type": "string",
"description": ""
},
"delivery_shipment_id": {
"type": "string",
"description": ""
},
"detail": {
"$ref": "#/definitions/VrpResultSolutionRouteActivityDetails",
"description": ""
}
}
},
"VrpResultSolutionRouteActivityDetails": {
"type": "object",
"properties": {
"router_mode": {
"type": "string",
"description": "Means of transport used to reach this activity, it may vary within a route if subtours are defined"
},
"speed_multiplier": {
"type": "string",
"description": "Speed multiplier applied to the current means of transport, it may vary within a route if subtours are defined"
},
"lat": {
"type": "number",
"format": "float",
"description": ""
},
"lon": {
"type": "number",
"format": "float",
"description": ""
},
"skills": {
"type": "string",
"description": ""
},
"setup_duration": {
"type": "integer",
"format": "int32",
"description": ""
},
"duration": {
"type": "integer",
"format": "int32",
"description": ""
},
"additional_value": {
"type": "integer",
"format": "int32",
"description": ""
},
"quantities": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultDetailQuantities"
},
"description": ""
},
"timewindows": {
"type": "array",
"items": {
"$ref": "#/definitions/VrpResultSolutionRouteActivityDetailTimewindows"
},
"description": ""
}
}
},
"VrpResultDetailQuantities": {
"type": "object",
"properties": {
"unit": {
"type": "string",
"description": ""
},
"value": {
"type": "number",
"format": "float",
"description": ""
},
"setup_value": {
"type": "number",
"format": "float",
"description": ""
},
"current_load": {
"type": "number",
"format": "float",
"description": ""
}
}
},
"VrpResultSolutionRouteActivityDetailTimewindows": {
"type": "object",
"properties": {
"start": {
"type": "integer",
"format": "int32",
"description": ""
},
"end": {
"type": "integer",
"format": "int32",
"description": ""
}
}
},
"VrpResultSolutionUnassigneds": {
"type": "object",
"properties": {
"point_id": {
"type": "string",
"description": "Linked spatial point"
},
"service_id": {
"type": "string",
"description": ""
},
"pickup_shipment_id": {
"type": "string",
"description": ""
},
"delivery_shipment_id": {
"type": "string",
"description": ""
},
"detail": {
"$ref": "#/definitions/VrpResultSolutionRouteActivityDetails",
"description": ""
}
}
},
"post01VrpSubmit": {
"type": "object",
"properties": {
"vrp": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the problem, used as tag for all element in order to name plan when importing returned .csv file"
},
"matrices": {
"type": "array",
"description": "Define all the distances between each point of problem",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"time": {
"type": "array",
"description": "Matrix of time, travel duration between each pair of point in the problem. It must be send as an Array[Array[Float]] as it could potentially be non squared matrix",
"items": {
"type": "number",
"format": "float"
}
},
"distance": {
"type": "array",
"description": "Matrix of distance, travel distance between each pair of point in the problem. It must be send as an Array[Array[Float]] as it could potentially be non squared matrix",
"items": {
"type": "number",
"format": "float"
}
},
"value": {
"type": "array",
"description": "Matrix of values, travel value between each pair of point in the problem if not distance or time related. It must be send as an Array[Array[Float]] as it could potentially be non squared matrix",
"items": {
"type": "number",
"format": "float"
}
}
},
"required": [
"id"
]
}
},
"points": {
"type": "array",
"description": "Particular place in the map",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"matrix_index": {
"type": "integer",
"format": "int32",
"description": "Index within the matrices, required if the matrices are already given"
},
"location": {
"type": "object",
"description": "Location of the point if matrices are not given",
"properties": {
"lat": {
"type": "number",
"format": "float",
"description": "Latitude coordinate"
},
"lon": {
"type": "number",
"format": "float",
"description": "Longitude coordinate"
}
},
"required": [
"lat",
"lon"
]
}
},
"required": [
"id"
]
}
},
"units": {
"type": "array",
"description": "The name of a Capacity/Quantity",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string",
"description": "Name of the unit"
},
"counting": {
"type": "boolean",
"description": "Define if the unit is a counting one, which allows to count the number of stops in a single route"
}
},
"required": [
"id"
]
}
},
"rests": {
"type": "array",
"description": "Break within a vehicle tour",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"duration": {
"type": "string",
"description": "Duration of the vehicle rest"
},
"timewindows": {
"type": "array",
"description": "Time slot while the rest may begin",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
}
},
"late_multiplier": {
"type": "number",
"format": "float",
"description": "Late multiplier applied for this rest."
},
"exclusion_cost": {
"type": "number",
"format": "float",
"description": "Cost induced by non affectation of this rest."
}
},
"required": [
"id",
"duration"
]
}
},
"zones": {
"type": "array",
"description": "",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"polygon": {
"type": "object",
"description": "Geometry which describes the area"
},
"allocations": {
"type": "array",
"description": "Define by which vehicle or vehicles combination the zone could be served",
"items": {
"type": "string"
}
}
},
"required": [
"id",
"polygon"
]
}
},
"vehicles": {
"type": "array",
"description": "Usually represent a work day of a particular driver/vehicle",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"cost_fixed": {
"type": "number",
"format": "float",
"description": "Cost applied if the vehicle is used"
},
"cost_distance_multiplier": {
"type": "number",
"format": "float",
"description": "Cost applied to the distance performed"
},
"cost_time_multiplier": {
"type": "number",
"format": "float",
"description": "Cost applied to the total amount of time of travel (Jsprit) or to the total time of route (ORtools)"
},
"cost_value_multiplier": {
"type": "number",
"format": "float",
"description": "Multiplier applied to the value matrix and additional activity value"
},
"cost_waiting_time_multiplier": {
"type": "number",
"format": "float",
"description": "Cost applied to the waiting time in the route (Jsprit Only)"
},
"cost_late_multiplier": {
"type": "number",
"format": "float",
"description": "Cost applied if a point is delivered late (ORtools only)"
},
"cost_setup_time_multiplier": {
"type": "number",
"format": "float",
"description": "Cost applied on the setup duration (Jsprit only)"
},
"coef_setup": {
"type": "number",
"format": "float",
"description": "Coefficient applied to every setup duration defined in the tour, for this vehicle"
},
"additional_setup": {
"type": "number",
"format": "float",
"description": "Constant additional setup duration for all setup defined in the tour, for this vehicle"
},
"coef_service": {
"type": "number",
"format": "float",
"description": "Coefficient applied to every service duration defined in the tour, for this vehicle"
},
"additional_service": {
"type": "number",
"format": "float",
"description": "Constant additional service time for all travel defined in the tour, for this vehicle"
},
"shift_preference": {
"type": "string",
"description": "Force the vehicle to start as soon as the vehicle timewindow is open, as late as possible or let vehicule start at any time. Not available with periodic heuristic.",
"enum": [
"force_start",
"force_end",
"minimize_span"
]
},
"trips": {
"type": "integer",
"format": "int32",
"description": "Describe the number of return to the depot a vehicle is allowed to perform within its route"
},
"matrix_id": {
"type": "string",
"description": "Related matrix, if already defined"
},
"value_matrix_id": {
"type": "string",
"description": "If any value matrix defined, related matrix index."
},
"router_mode": {
"type": "string",
"description": "car, truck, bicycle...etc. See the Router Wrapper API doc"
},
"router_dimension": {
"type": "string",
"description": "time or dimension, choose between a matrix based on minimal route duration or on minimal route distance",
"enum": [
"time",
"distance"
]
},
"speed_multiplier": {
"type": "number",
"format": "float",
"description": "Multiplies the vehicle speed, default : 1.0. Specifies if this vehicle is faster or slower than average speed.",
"default": 1.0
},
"area": {
"type": "array",
"description": "List of latitudes and longitudes separated with commas. Areas separated with pipes (only available for truck mode at this time).",
"items": {
"type": "string"
}
},
"speed_multiplier_area": {
"type": "array",
"description": "Speed multiplier per area, 0 to avoid area. Areas separated with pipes (only available for truck mode at this time).",
"items": {
"type": "number",
"format": "float"
}
},
"traffic": {
"type": "boolean",
"description": "Take into account traffic or not.",
"default": true
},
"departure": {
"type": "string",
"format": "date-time",
"description": "Departure date time (only used if router supports traffic)."
},
"track": {
"type": "boolean",
"description": "Use track or not.",
"default": true
},
"motorway": {
"type": "boolean",
"description": "Use motorway or not.",
"default": true
},
"toll": {
"type": "boolean",
"description": "Use toll section or not.",
"default": true
},
"trailers": {
"type": "integer",
"format": "int32",
"description": "Number of trailers."
},
"weight": {
"type": "number",
"format": "float",
"description": "Vehicle weight including trailers and shipped goods, in tons."
},
"weight_per_axle": {
"type": "number",
"format": "float",
"description": "Weight per axle, in tons."
},
"height": {
"type": "number",
"format": "float",
"description": "Height in meters."
},
"width": {
"type": "number",
"format": "float",
"description": "Width in meters."
},
"length": {
"type": "number",
"format": "float",
"description": "Length in meters."
},
"hazardous_goods": {
"type": "string",
"description": "List of hazardous materials in the vehicle.",
"enum": [
"explosive",
"gas",
"flammable",
"combustible",
"organic",
"poison",
"radio_active",
"corrosive",
"poisonous_inhalation",
"harmful_to_water",
"other"
]
},
"max_walk_distance": {
"type": "number",
"format": "float",
"description": "Max distance by walk.",
"default": 750
},
"approach": {
"type": "string",
"description": "Arrive/Leave in the traffic direction.",
"enum": [
"unrestricted",
"curb"
],
"default": "unrestricted"
},
"snap": {
"type": "number",
"format": "float",
"description": "Snap waypoint to junction close by snap distance."
},
"strict_restriction": {
"type": "boolean",
"description": "Strict compliance with truck limitations."
},
"duration": {
"type": "string",
"description": "Maximum tour duration"
},
"overall_duration": {
"type": "string",
"description": "[planning] If schedule covers several days, maximum work duration over whole period. Not available with periodic heuristic."
},
"distance": {
"type": "integer",
"format": "int32",
"description": "Maximum tour distance. Not available with periodic heuristic."
},
"maximum_ride_time": {
"type": "integer",
"format": "int32",
"description": "Maximum ride duration between two route activities"
},
"maximum_ride_distance": {
"type": "integer",
"format": "int32",
"description": "Maximum ride distance between two route activities"
},
"skills": {
"type": "array",
"description": "Particular abilities which could be handle by the vehicle. Not available with periodic heuristic. This parameter is a set of alternative skills, and must be defined as an Array[Array[String]]",
"items": {
"type": "string"
}
},
"unavailable_work_day_indices": {
"type": "array",
"description": "[planning] Express the exceptionnals indices of unavailabilty",
"items": {
"type": "integer",
"format": "int32"
}
},
"unavailable_work_date": {
"type": "array",
"description": "[planning] Express the exceptionnals days of unavailability",
"items": {
"type": "string"
}
},
"free_approach": {
"type": "boolean",
"description": "Do not take into account the route leaving the depot in the objective. Not available with periodic heuristic."
},
"free_return": {
"type": "boolean",
"description": "Do not take into account the route arriving at the depot in the objective. Not available with periodic heuristic."
},
"start_point_id": {
"type": "string",
"description": "Begin of the tour"
},
"end_point_id": {
"type": "string",
"description": "End of the tour"
},
"capacities": {
"type": "array",
"description": "Define the limit of entities the vehicle could carry",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"unit_id": {
"type": "string",
"description": "Unit of the capacity"
},
"limit": {
"type": "number",
"format": "float",
"description": "Maximum capacity that can be carried"
},
"initial": {
"type": "number",
"format": "float",
"description": "Initial quantity value loaded in the vehicle"
},
"overload_multiplier": {
"type": "number",
"format": "float",
"description": "Allows to exceed the limit against this cost (ORtools only)"
}
},
"required": [
"unit_id",
"limit"
]
}
},
"sequence_timewindows": {
"type": "array",
"description": "[planning] Define the vehicle work schedule over a period",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
}
},
"timewindow_id": {
"type": "string",
"description": "Sequence timewindows to consider"
},
"timewindow": {
"type": "object",
"description": "Time window whithin the vehicle may be on route",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
},
"rest_ids": {
"type": "array",
"description": "Breaks whithin the tour",
"items": {
"type": "string"
}
}
},
"required": [
"id"
]
}
},
"services": {
"type": "array",
"description": "Independent activity, which does not require a context",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"priority": {
"type": "integer",
"format": "int32",
"description": "Priority assigned to the service in case of conflict to assign every jobs (from 0 to 8, default is 4. 0 is the highest priority level). Not available with same_point_day option.",
"minimum": 0,
"maximum": 8
},
"exclusion_cost": {
"type": "integer",
"format": "int32",
"description": "Exclusion cost. Not available with periodic heuristic."
},
"visits_number": {
"type": "integer",
"format": "int32",
"description": "Total number of visits over the complete schedule (including the unavailable visit indices)",
"default": 1
},
"unavailable_visit_indices": {
"type": "array",
"description": "[planning] unavailable indices of visit",
"items": {
"type": "integer",
"format": "int32"
}
},
"unavailable_visit_day_indices": {
"type": "array",
"description": "[planning] Express the exceptionnals days indices of unavailabilty",
"items": {
"type": "integer",
"format": "int32"
}
},
"unavailable_visit_day_date": {
"type": "array",
"description": "[planning] Express the exceptionnals days of unavailability",
"items": {
"type": "string"
}
},
"minimum_lapse": {
"type": "number",
"format": "float",
"description": "Minimum day lapse between two visits"
},
"maximum_lapse": {
"type": "number",
"format": "float",
"description": "Maximum day lapse between two visits"
},
"sticky_vehicle_ids": {
"type": "array",
"description": "Defined to which vehicle the service is assigned",
"items": {
"type": "string"
}
},
"skills": {
"type": "array",
"description": "Particular abilities required by a vehicle to perform this service",
"items": {
"type": "string"
}
},
"type": {
"type": "string",
"description": "service, pickup or delivery"
},
"activity": {
"type": "object",
"description": "Details of the activity performed to accomplish the current service",
"properties": {
"duration": {
"type": "string",
"description": "Time while the current activity stands until it's over (in seconds)"
},
"additional_value": {
"type": "integer",
"format": "int32",
"description": "Additional value associated to the visit"
},
"setup_duration": {
"type": "string",
"description": "Time at destination before the proper activity is effectively performed"
},
"late_multiplier": {
"type": "number",
"format": "float",
"description": "Overrides the late_multiplier defined at the vehicle level (ORtools only)"
},
"point_id": {
"type": "string",
"description": "Reference to the associated point"
},
"timewindows": {
"type": "array",
"description": "Time slot while the activity may start",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
}
}
},
"required": [
"point_id"
]
},
"activities": {
"type": "array",
"description": "Define other possible activities for the service. This allows to assign different timewindows and/or points to a single service.",
"items": {
"type": "object",
"properties": {
"duration": {
"type": "string",
"description": "Time while the current activity stands until it's over (in seconds)"
},
"additional_value": {
"type": "integer",
"format": "int32",
"description": "Additional value associated to the visit"
},
"setup_duration": {
"type": "string",
"description": "Time at destination before the proper activity is effectively performed"
},
"late_multiplier": {
"type": "number",
"format": "float",
"description": "Overrides the late_multiplier defined at the vehicle level (ORtools only)"
},
"point_id": {
"type": "string",
"description": "Reference to the associated point"
},
"timewindows": {
"type": "array",
"description": "Time slot while the activity may start",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
}
}
},
"required": [
"point_id"
]
}
},
"quantities": {
"type": "array",
"description": "Define the entities which are taken or dropped",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"unit_id": {
"type": "string",
"description": "Unit related to this quantity"
},
"fill": {
"type": "boolean",
"description": "Allows to fill with quantity, until this unit vehicle capacity is full"
},
"empty": {
"type": "boolean",
"description": "Allows to empty this quantity, until this unit vehicle capacity reaches zero"
},
"value": {
"type": "number",
"format": "float",
"description": "Value of current quantity"
},
"setup_value": {
"type": "integer",
"format": "int32",
"description": "If the associated unit is a counting one, defines the default value to count for this stop (additional quantities for this specific service are to define with the value tag)"
}
},
"required": [
"unit_id"
]
}
}
},
"required": [
"id"
]
}
},
"shipments": {
"type": "array",
"description": "Link directly one activity of collection to another of drop off",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"priority": {
"type": "integer",
"format": "int32",
"description": "Priority assigned to the service in case of conflict to assign every jobs (from 0 to 8, default is 4)",
"minimum": 0,
"maximum": 8
},
"exclusion_cost": {
"type": "integer",
"format": "int32",
"description": "Exclusion cost"
},
"visits_number": {
"type": "integer",
"format": "int32",
"description": "Total number of visits over the complete schedule (including the unavailable visit indices)",
"default": 1
},
"unavailable_visit_indices": {
"type": "array",
"description": "[planning] unavailable indices of visit",
"items": {
"type": "integer",
"format": "int32"
}
},
"unavailable_visit_day_indices": {
"type": "array",
"description": "[planning] Express the exceptionnals days indices of unavailabilty",
"items": {
"type": "integer",
"format": "int32"
}
},
"unavailable_visit_day_date": {
"type": "array",
"description": "[planning] Express the exceptionnals days of unavailability",
"items": {
"type": "string"
}
},
"minimum_lapse": {
"type": "number",
"format": "float",
"description": "Minimum day lapse between two visits"
},
"maximum_lapse": {
"type": "number",
"format": "float",
"description": "Maximum day lapse between two visits"
},
"maximum_inroute_duration": {
"type": "integer",
"format": "int32",
"description": "Maximum in route duration of this particular shipment (Must be feasible !)"
},
"sticky_vehicle_ids": {
"type": "array",
"description": "Defined to which vehicle the shipment is assigned",
"items": {
"type": "string"
}
},
"skills": {
"type": "array",
"description": "Particular abilities required by a vehicle to perform this shipment",
"items": {
"type": "string"
}
},
"pickup": {
"type": "object",
"description": "Activity of collection",
"properties": {
"duration": {
"type": "string",
"description": "Time while the current activity stands until it's over (in seconds)"
},
"additional_value": {
"type": "integer",
"format": "int32",
"description": "Additional value associated to the visit"
},
"setup_duration": {
"type": "string",
"description": "Time at destination before the proper activity is effectively performed"
},
"late_multiplier": {
"type": "number",
"format": "float",
"description": "Overrides the late_multiplier defined at the vehicle level (ORtools only)"
},
"point_id": {
"type": "string",
"description": "Reference to the associated point"
},
"timewindows": {
"type": "array",
"description": "Time slot while the activity may start",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
}
}
},
"required": [
"point_id"
]
},
"delivery": {
"type": "object",
"description": "Activity of drop off",
"properties": {
"duration": {
"type": "string",
"description": "Time while the current activity stands until it's over (in seconds)"
},
"additional_value": {
"type": "integer",
"format": "int32",
"description": "Additional value associated to the visit"
},
"setup_duration": {
"type": "string",
"description": "Time at destination before the proper activity is effectively performed"
},
"late_multiplier": {
"type": "number",
"format": "float",
"description": "Overrides the late_multiplier defined at the vehicle level (ORtools only)"
},
"point_id": {
"type": "string",
"description": "Reference to the associated point"
},
"timewindows": {
"type": "array",
"description": "Time slot while the activity may start",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"start": {
"type": "string",
"description": "Beginning of the current timewindow in seconds"
},
"end": {
"type": "string",
"description": "End of the current timewindow in seconds"
},
"day_index": {
"type": "integer",
"format": "int32",
"description": "[ Planning ] Day index of the current timewindow within the periodic week, (monday = 0, ..., sunday = 6)",
"minimum": 0,
"maximum": 6
}
}
}
}
},
"required": [
"point_id"
]
},
"quantities": {
"type": "array",
"description": "Define the entities which are taken and dropped",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"unit_id": {
"type": "string",
"description": "Unit related to this quantity"
},
"fill": {
"type": "boolean",
"description": "Allows to fill with quantity, until this unit vehicle capacity is full"
},
"empty": {
"type": "boolean",
"description": "Allows to empty this quantity, until this unit vehicle capacity reaches zero"
},
"value": {
"type": "number",
"format": "float",
"description": "Value of current quantity"
},
"setup_value": {
"type": "integer",
"format": "int32",
"description": "If the associated unit is a counting one, defines the default value to count for this stop (additional quantities for this specific service are to define with the value tag)"
}
},
"required": [
"unit_id"
]
}
}
},
"required": [
"id",
"pickup",
"delivery"
]
}
},
"relations": {
"type": "array",
"description": "",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"description": "Relations allow to define constraints explicitly between activities and/or vehicles. It could be the following types: same_route, sequence, order, minimum_day_lapse, maximum_day_lapse, shipment, meetup, maximum_duration_lapse, force_first, never_first, force_end, vehicle_group_duration, vehicle_group_duration_on_weeks or vehicle_group_duration_on_months",
"enum": [
"same_route",
"sequence",
"order",
"minimum_day_lapse",
"maximum_day_lapse",
"shipment",
"meetup",
"maximum_duration_lapse",
"force_first",
"never_first",
"force_end",
"vehicle_group_duration",
"vehicle_group_duration_on_weeks",
"vehicle_group_duration_on_months"
]
},
"lapse": {
"type": "integer",
"format": "int32",
"description": "Only used for relations implying a duration constraint : minimum/maximum day lapse, vehicle group durations..."
},
"linked_ids": {
"type": "array",
"description": "List of activities involved in the relation",
"items": {
"type": "string"
}
},
"linked_vehicle_ids": {
"type": "array",
"description": "List of vehicles involved in the relation",
"items": {
"type": "string"
}
},
"periodicity": {
"type": "integer",
"format": "int32",
"description": "In the case of planning optimization, number of weeks/months to consider at the same time/in each relation : vehicle group duration on weeks/months"
}
},
"required": [
"id",
"type"
]
}
},
"subtours": {
"type": "array",
"description": "",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"time_bounds": {
"type": "integer",
"format": "int32",
"description": "Time limit from the transmodal points (Isochrone)"
},
"distance_bounds": {
"type": "integer",
"format": "int32",
"description": "Distance limit from the transmodal points (Isodistanche)"
},
"router_mode": {
"type": "string",
"description": "car, truck, bicycle...etc. See the Router Wrapper API doc"
},
"router_dimension": {
"type": "string",
"description": "time or dimension, choose between a matrix based on minimal route duration or on minimal route distance",
"enum": [
"time",
"distance"
]
},
"speed_multiplier": {
"type": "number",
"format": "float",
"description": "multiply the current modality speed, default : 1.0",
"default": 1.0
},
"skills": {
"type": "array",
"description": "Particular abilities required by a vehicle to perform this subtour",
"items": {
"type": "string"
}
},
"duration": {
"type": "integer",
"format": "int32",
"description": "Maximum subtour duration"
},
"transmodal_stops": {
"type": "array",
"description": "Point where the vehicles can park and start the subtours",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"matrix_index": {
"type": "integer",
"format": "int32",
"description": "Index within the matrices, required if the matrices are already given"
},
"location": {
"type": "object",
"description": "Location of the point if matrices are not given",
"properties": {
"lat": {
"type": "number",
"format": "float",
"description": "Latitude coordinate"
},
"lon": {
"type": "number",
"format": "float",
"description": "Longitude coordinate"
}
},
"required": [
"lat",
"lon"
]
}
},
"required": [
"id"
]
}
},
"capacities": {
"type": "array",
"description": "Define the limit of entities the subtour modality can handle",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"unit_id": {
"type": "string",
"description": "Unit of the capacity"
},
"limit": {
"type": "number",
"format": "float",
"description": "Maximum capacity that can be carried"
},
"initial": {
"type": "number",
"format": "float",
"description": "Initial quantity value loaded in the vehicle"
},
"overload_multiplier": {
"type": "number",
"format": "float",
"description": "Allows to exceed the limit against this cost (ORtools only)"
}
},
"required": [
"unit_id",
"limit"
]
}
}
},
"required": [
"id"
]
}
},
"routes": {
"type": "array",
"description": "",
"items": {
"type": "object",
"properties": {
"vehicle_id": {
"type": "string",
"description": "vehicle linked to the current described route"
},
"indice": {
"type": "integer",
"format": "int32",
"description": "Indice of the route. Must be provided if first_solution_strategy is 'periodic'."
},
"date": {
"type": "string",
"format": "date",
"description": "Date of the route. Must be provided if first_solution_strategy is 'periodic'."
},
"mission_ids": {
"type": "array",
"description": "Initial state or partial state of the current vehicle route",
"items": {
"type": "string"
}
},
"day": {
"type": "string"
}
},
"required": [
"mission_ids"
]
}
},
"configuration": {
"type": "object",
"description": "Describe the limitations of the solve in term of computation",
"properties": {
"preprocessing": {
"type": "object",
"description": "Parameters independent from the search",
"properties": {
"max_split_size": {
"type": "integer",
"format": "int32",
"description": "Divide the problem into clusters beyond this threshold"
},
"kmeans_centroids": {
"type": "array",
"description": "Forces centroid indices used to generate clusters with kmeans partition_method. Only available with deprecated partition_method",
"items": {
"type": "integer",
"format": "int32"
}
},
"cluster_threshold": {
"type": "number",
"format": "float",
"description": "Regroup close points which constitute a cluster into a single geolocated point"
},
"force_cluster": {
"type": "boolean",
"description": "Force to cluster visits even if containing timewindows and quantities"
},
"prefer_short_segment": {
"type": "boolean",
"description": "Could allow to pass multiple time in the same street but deliver in a single row"
},
"neighbourhood_size": {
"type": "integer",
"format": "int32",
"description": "Limit the size of the considered neighbourhood within the search"
},
"partitions": {
"type": "array",
"description": "Describes partition process to perform before solving. Partitions will be performed in provided order",
"items": {
"type": "object",
"properties": {
"method": {
"type": "string",
"description": "Method used to partition",
"enum": [
"hierarchical_tree",
"balanced_kmeans"
]
},
"metric": {
"type": "string",
"description": "Defines partition reference metric. Values should be either duration, visits or any unit you defined in units."
},
"entity": {
"type": "string",
"description": "Describes what the partition corresponds to. Only available if method in [balanced_kmeans hierarchical_tree]",
"enum": [
"vehicle",
"work_day"
]
},
"threshold": {
"type": "integer",
"format": "int32",
"description": "Maximum size of partition. Only available if method in [iterative_kmean clique]"
}
},
"required": [
"method"
]
}
},
"first_solution_strategy": {
"type": "array",
"description": "Forces first solution strategy. Either one value to force specific behavior, or a list in order to test several ones and select the best. If string is 'internal', we will choose among pre-selected behaviors. There can not be more than three behaviors (ORtools only)",
"items": {
"type": "string"
}
}
}
},
"resolution": {
"type": "object",
"description": "Parameters used to stop the search",
"properties": {
"duration": {
"type": "integer",
"format": "int32",
"description": "Maximum duration of resolution"
},
"iterations": {
"type": "integer",
"format": "int32",
"description": "Maximum number of iterations (Jsprit only)"
},
"iterations_without_improvment": {
"type": "integer",
"format": "int32",
"description": "Maximum number of iterations without improvment from the best solution already found"
},
"stable_iterations": {
"type": "integer",
"format": "int32",
"description": "maximum number of iterations without variation in the solve bigger than the defined coefficient (Jsprit only)"
},
"stable_coefficient": {
"type": "number",
"format": "float",
"description": "variation coefficient related to stable_iterations (Jsprit only)"
},
"minimum_duration": {
"type": "integer",
"format": "int32",
"description": "Minimum solve duration before the solve could stop (x10 in order to find the first solution) (ORtools only)"
},
"time_out_multiplier": {
"type": "integer",
"format": "int32",
"description": "the solve could stop itself if the solve duration without finding a new solution is greater than the time currently elapsed multiplicate by this parameter (ORtools only)"
},
"vehicle_limit": {
"type": "integer",
"format": "int32",
"description": "Limit the maxiumum number of vehicles within a solution. Not available with periodic heuristic."
},
"solver": {
"type": "boolean",
"description": "Defines if solver should be called.",
"default": true
},
"same_point_day": {
"type": "boolean",
"description": "[planning] Forces all services with the same point_id to take place on the same days. Only available if first_solution_strategy is periodic is activated. Not available ORtools."
},
"allow_partial_assignment": {
"type": "boolean",
"description": "[planning] Assumes solution is valid even if only a subset of one service's visits are affected. Default: true. Not available ORtools.",
"default": true
},
"split_number": {
"type": "integer",
"format": "int32",
"description": "Give the current number of process for block call"
},
"evaluate_only": {
"type": "boolean",
"description": "Takes the solution provided through relations of type order and computes solution cost and time/distance associated values (Ortools only). Not available for scheduling yet."
},
"several_solutions": {
"type": "integer",
"format": "int32",
"description": "Return several solution computed with different matrices"
},
"batch_heuristic": {
"type": "boolean",
"description": "Compute each heuristic solution"
},
"variation_ratio": {
"type": "integer",
"format": "int32",
"description": "Value of the ratio that will change the matrice"
}
}
},
"restitution": {
"type": "object",
"description": "Restitution paramaters",
"properties": {
"geometry": {
"type": "boolean",
"description": "Allow to return the MultiLineString of each route"
},
"geometry_polyline": {
"type": "boolean",
"description": "Encode the MultiLineString"
},
"intermediate_solutions": {
"type": "boolean",
"description": "Return intermediate solutions if available"
},
"csv": {
"type": "boolean",
"description": "The output is a CSV file if you do not specify api format"
},
"allow_empty_result": {
"type": "boolean",
"description": "Allow no solution from the solver used"
}
}
},
"schedule": {
"type": "object",
"description": "Describe the general settings of a schedule",
"properties": {
"range_indices": {
"type": "object",
"description": "[planning] Day indices within the plan has to be build",
"properties": {
"start": {
"type": "integer",
"format": "int32",
"description": "Beginning of the range."
},
"end": {
"type": "integer",
"format": "int32",
"description": "End of the range."
}
}
},
"range_date": {
"type": "object",
"description": "[planning] Define the total period to consider",
"properties": {
"start": {
"type": "string",
"format": "date",
"description": "Beginning of the range in date format : ."
},
"end": {
"type": "string",
"format": "date",
"description": "End of the range in date format : ."
}
}
},
"unavailable_indices": {
"type": "array",
"description": "[planning] Exclude some days indices from the resolution",
"items": {
"type": "integer",
"format": "int32"
}
},
"unavailable_date": {
"type": "array",
"description": "[planning] Exclude some days from the resolution",
"items": {
"type": "string",
"format": "date"
}
}
}
}
}
}
},
"required": [
"vehicles"
]
}
},
"description": "Submit VRP problem"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment