{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/online","auth":"required","params":[{"name":"problem","type":"object","default":"","desc":"The original routing problem.","required":true,"in":"body","ref":"","_id":"57a06f4c19a5850e0096a9f5"},{"name":"routes","type":"array_object","default":"","desc":"The routes from the solution of the original problem.","required":true,"in":"body","ref":"","_id":"57a06f4c19a5850e0096a9f4"},{"name":"newJobs","type":"array_object","default":"","desc":"An array of new jobs to be added to the given routes. Can be up to 10 jobs.","required":true,"in":"body","ref":"","_id":"57a06f4c19a5850e0096a9f1"},{"name":"x-api-key","type":"string","default":"","desc":"An API key.","required":false,"in":"header","ref":"","_id":"57a075320c933e0e00249bc5"}],"results":{"codes":[{"name":"","code":"{\n\t\"routes\": Array[Object[Route]]\n}","language":"json","status":"2XX"},{"name":"","code":"{\n  \"error\": String,\n  \"errorCode\": String\n}","language":"json","status":"4XX"}]},"settings":"576a36aadd4f320e0060b806","examples":{"codes":[{"code":"{\n  \"problem\": {\n    \"drivers\": [\n      {\n        \"id\": \"d1\",\n        \"maxCapacity\": {\n          \"data\": {\n            \"Volume\": 1000000.0\n          }\n        },\n        \"startTime\": {\n          \"epoch\": 1455356400\n        },\n        \"endTime\": {\n          \"epoch\": 1455375540\n        },\n        \"skillLevel\": 0,\n        \"vehicleFeatures\": [],\n        \"maxWaitTime\": {\n          \"seconds\": 0\n        }\n      }\n    ],\n    \"jobs\": [\n      {\n        \"id\": \"j1\",\n        \"tasks\": [\n          {\n            \"id\": \"t1\",\n            \"jobId\": \"j1\",\n            \"taskType\": \"PickUp\",\n            \"location\": {\n              \"labels\": [\n                \"15823\"\n              ],\n              \"x\": 126.9,\n              \"y\": 37.3\n            },\n            \"capacity\": {\n              \"data\": {\n                \"Volume\": 62400.0\n              }\n            },\n            \"taskDuration\": {\n              \"seconds\": 300\n            },\n            \"timeWindow\": {\n              \"start\": {\n                \"epoch\": 1455357600\n              },\n              \"end\": {\n                \"epoch\": 1455368400\n              }\n            },\n            \"difficulty\": 0\n          }\n        ],\n        \"partialOrder\": []\n      }\n    ],\n    \"hardConstraints\": [\n      {\n        \"type\": \"TimeWindowConstraint\",\n        \"weight\": 1.0\n      }\n    ],\n    \"softConstraints\": [\n      {\n        \"type\": \"CapacityConstraint\",\n        \"weight\": 100.0\n      }\n    ],\n    \"config\": {\n      \"gis\": {\n        \"type\": \"SimpleGIS\",\n        \"drivingFactor\": 1.26,\n        \"averageSpeed\": 40.0\n      },\n      \"depot\": {\n        \"id\": \"depot1\",\n        \"location\": {\n          \"labels\": [],\n          \"x\": 127.1,\n          \"y\": 37.3\n        }\n      },\n      \"returnToDepot\": true,\n      \"postGis\": false\n    }\n  },\n  \"routes\": [\n    {\n      \"driver\": {\n        \"id\": \"d1\",\n        \"maxCapacity\": {\n          \"data\": {\n            \"Volume\": 1000000.0\n          }\n        },\n        \"startLocation\": {\n          \"labels\": [],\n          \"x\": 128.1,\n          \"y\": 37.1\n        },\n        \"endLocation\": {\n          \"labels\": [],\n          \"x\": 128.1,\n          \"y\": 37.1\n        },\n        \"startTime\": {\n          \"epoch\": 1455340000\n        },\n        \"endTime\": {\n          \"epoch\": 1455370000\n        },\n        \"skillLevel\": 0,\n        \"vehicleFeatures\": []\n      },\n      \"jobs\": [\n        {\n          \"id\": \"j1\",\n          \"tasks\": [\n            {\n              \"id\": \"t1\",\n              \"jobId\": \"j1\",\n              \"taskType\": \"DepotDelivery\",\n              \"location\": {\n                \"labels\": [],\n                \"x\": 126.9,\n                \"y\": 37.3\n              },\n              \"capacity\": {\n                \"data\": {\n                  \"Volume\": 100.0\n                }\n              },\n              \"taskDuration\": {\n                \"seconds\": 300\n              },\n              \"timeWindow\": {\n                \"start\": {\n                  \"epoch\": 1455354000\n                },\n                \"end\": {\n                  \"epoch\": 1455364800\n                }\n              },\n              \"difficulty\": 0\n            }\n          ],\n          \"partialOrder\": []\n        }\n      ],\n      \"tasks\": [\n        {\n          \"id\": \"t1\",\n          \"jobId\": \"j1\",\n          \"taskType\": \"DepotDelivery\",\n          \"location\": {\n            \"labels\": [],\n            \"x\": 126.9,\n            \"y\": 37.3\n          },\n          \"capacity\": {\n            \"data\": {\n              \"Volume\": 100.0\n            }\n          },\n          \"taskDuration\": {\n            \"seconds\": 300\n          },\n          \"timeWindow\": {\n            \"start\": {\n              \"epoch\": 1455354000\n            },\n            \"end\": {\n              \"epoch\": 1455364800\n            }\n          },\n          \"difficulty\": 0\n        }\n      ],\n      \"gis\": {\n        \"type\": \"SimpleGIS\",\n        \"drivingFactor\": 1.26,\n        \"averageSpeed\": 40.0\n      }\n    }\n  ],\n  \"newJobs\": [\n    {\n      \"id\": \"j1\",\n      \"tasks\": [\n        {\n          \"id\": \"a1\",\n          \"jobId\": \"c1\",\n          \"taskType\": \"DepotDelivery\",\n          \"location\": {\n            \"labels\": [\n              \"25823\"\n            ],\n            \"x\": 106.9,\n            \"y\": 67.3\n          },\n          \"capacity\": {\n            \"data\": {\n              \"Volume\": 62400.0\n            }\n          },\n          \"taskDuration\": {\n            \"seconds\": 600\n          },\n          \"timeWindow\": {\n            \"start\": {\n              \"epoch\": 1455457600\n            },\n            \"end\": {\n              \"epoch\": 1455468400\n            }\n          },\n          \"difficulty\": 0\n        }\n      ],\n      \"partialOrder\": []\n    }\n  ]\n}","language":"json","name":"request - body"},{"name":"response - error","language":"json","code":"{\n  \"error\": \"Request with ID: [86d9cf4f-dfb8-45ac-b481-1a3516c38d58] is not valid\", \n  \"errorCode\": \"2004\"\n}"},{"code":"{\n  \"routes\": [\n    {\n      \"driver\": {\n        \"id\": \"d1\",\n        \"maxCapacity\": {\n          \"data\": {\n            \"Volume\": 1000000\n          }\n        },\n        \"startLocation\": {\n          \"x\": 128.1,\n          \"y\": 37.1,\n          \"labels\": []\n        },\n        \"endLocation\": {\n          \"x\": 128.1,\n          \"y\": 37.1,\n          \"labels\": []\n        },\n        \"startTime\": {\n          \"epoch\": 1455340000\n        },\n        \"endTime\": {\n          \"epoch\": 1455370000\n        },\n        \"skillLevel\": 0,\n        \"vehicleFeatures\": [],\n        \"maxWaitTime\": {\n          \"seconds\": 0\n        }\n      },\n      \"jobs\": [\n        {\n          \"id\": \"j1\",\n          \"tasks\": [\n            {\n              \"id\": \"t1\",\n              \"jobId\": \"j1\",\n              \"taskType\": \"DepotDelivery\",\n              \"location\": {\n                \"x\": 126.9,\n                \"y\": 37.3,\n                \"labels\": []\n              },\n              \"capacity\": {\n                \"data\": {\n                  \"Volume\": 100\n                }\n              },\n              \"taskDuration\": {\n                \"seconds\": 300\n              },\n              \"timeWindow\": {\n                \"start\": {\n                  \"epoch\": 1455354000\n                },\n                \"end\": {\n                  \"epoch\": 1455364800\n                }\n              },\n              \"difficulty\": 0\n            }\n          ],\n          \"partialOrder\": []\n        },\n        {\n          \"id\": \"j1\",\n          \"tasks\": [\n            {\n              \"id\": \"a1\",\n              \"jobId\": \"c1\",\n              \"taskType\": \"DepotDelivery\",\n              \"location\": {\n                \"x\": 106.9,\n                \"y\": 67.3,\n                \"labels\": [\n                  \"25823\"\n                ]\n              },\n              \"capacity\": {\n                \"data\": {\n                  \"Volume\": 62400\n                }\n              },\n              \"taskDuration\": {\n                \"seconds\": 600\n              },\n              \"timeWindow\": {\n                \"start\": {\n                  \"epoch\": 1455457600\n                },\n                \"end\": {\n                  \"epoch\": 1455468400\n                }\n              },\n              \"difficulty\": 0\n            }\n          ],\n          \"partialOrder\": []\n        }\n      ],\n      \"tasks\": [\n        {\n          \"id\": \"a1\",\n          \"jobId\": \"c1\",\n          \"taskType\": \"DepotDelivery\",\n          \"location\": {\n            \"x\": 106.9,\n            \"y\": 67.3,\n            \"labels\": [\n              \"25823\"\n            ]\n          },\n          \"capacity\": {\n            \"data\": {\n              \"Volume\": 62400\n            }\n          },\n          \"taskDuration\": {\n            \"seconds\": 600\n          },\n          \"timeWindow\": {\n            \"start\": {\n              \"epoch\": 1455457600\n            },\n            \"end\": {\n              \"epoch\": 1455468400\n            }\n          },\n          \"difficulty\": 0\n        },\n        {\n          \"id\": \"t1\",\n          \"jobId\": \"j1\",\n          \"taskType\": \"DepotDelivery\",\n          \"location\": {\n            \"x\": 126.9,\n            \"y\": 37.3,\n            \"labels\": []\n          },\n          \"capacity\": {\n            \"data\": {\n              \"Volume\": 100\n            }\n          },\n          \"taskDuration\": {\n            \"seconds\": 300\n          },\n          \"timeWindow\": {\n            \"start\": {\n              \"epoch\": 1455354000\n            },\n            \"end\": {\n              \"epoch\": 1455364800\n            }\n          },\n          \"difficulty\": 0\n        }\n      ],\n      \"gis\": {\n        \"type\": \"SimpleGIS\",\n        \"drivingFactor\": 1.26,\n        \"averageSpeed\": 40\n      }\n    }\n  ]\n}","language":"json","name":"response - success"}]},"method":"post"},"next":{"description":"","pages":[]},"title":"/online","type":"endpoint","slug":"online","excerpt":"Solve an already-solved problem with an additional job","body":"","updates":[],"order":0,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57a069cf1435850e00dfbc10","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Online Routing API","slug":"online-algorithm","order":9999,"from_sync":false,"reference":false,"_id":"57a068f90c933e0e00249bae","version":"5706099c21cfed0e00e8c60e","createdAt":"2016-08-02T09:33:45.958Z","project":"5706099c21cfed0e00e8c60b","__v":0},"createdAt":"2016-08-02T09:37:19.292Z","githubsync":"","parentDoc":null,"version":{"version":"1.0.17","version_clean":"1.0.17","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["5706099c21cfed0e00e8c60f","573548f4afab4417007239cf","57354970fc5f1e0e001a463c","573549791f16241700c89fc9","57441052583f470e000a7947","57a068f90c933e0e00249bae"],"_id":"5706099c21cfed0e00e8c60e","createdAt":"2016-04-07T07:17:48.808Z","hasDoc":true,"project":"5706099c21cfed0e00e8c60b","__v":6,"hasReference":true,"releaseDate":"2016-04-07T07:17:48.808Z"},"__v":3,"project":"5706099c21cfed0e00e8c60b","user":"57456029c067580e0056b100"}

post/online

Solve an already-solved problem with an additional job

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

problem:
required
object
The original routing problem.
routes:
required
array of objects
The routes from the solution of the original problem.
newJobs:
required
array of objects
An array of new jobs to be added to the given routes. Can be up to 10 jobs.

Headers

x-api-key:
string
An API key.

Examples


Result Format


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}