{"_id":"57a069cf1435850e00dfbc10","category":{"_id":"57a068f90c933e0e00249bae","version":"5706099c21cfed0e00e8c60e","project":"5706099c21cfed0e00e8c60b","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-02T09:33:45.958Z","from_sync":false,"order":9999,"slug":"online-algorithm","title":"Online Routing API"},"githubsync":"","parentDoc":null,"version":{"_id":"5706099c21cfed0e00e8c60e","hasDoc":true,"project":"5706099c21cfed0e00e8c60b","__v":6,"hasReference":true,"createdAt":"2016-04-07T07:17:48.808Z","releaseDate":"2016-04-07T07:17:48.808Z","categories":["5706099c21cfed0e00e8c60f","573548f4afab4417007239cf","57354970fc5f1e0e001a463c","573549791f16241700c89fc9","57441052583f470e000a7947","57a068f90c933e0e00249bae"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.17","version":"1.0.17"},"__v":3,"project":"5706099c21cfed0e00e8c60b","user":"57456029c067580e0056b100","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-08-02T09:37:19.292Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":"2XX","language":"json","code":"{\n\t\"routes\": Array[Object[Route]]\n}","name":""},{"status":"4XX","language":"json","code":"{\n  \"error\": String,\n  \"errorCode\": String\n}","name":""}]},"settings":"576a36aadd4f320e0060b806","examples":{"codes":[{"name":"request - body","language":"json","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}"},{"code":"{\n  \"error\": \"Request with ID: [86d9cf4f-dfb8-45ac-b481-1a3516c38d58] is not valid\", \n  \"errorCode\": \"2004\"\n}","language":"json","name":"response - error"},{"name":"response - success","language":"json","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}"}]},"method":"post","auth":"required","params":[{"_id":"57a06f4c19a5850e0096a9f5","ref":"","in":"body","required":true,"desc":"The original routing problem.","default":"","type":"object","name":"problem"},{"_id":"57a06f4c19a5850e0096a9f4","ref":"","in":"body","required":true,"desc":"The routes from the solution of the original problem.","default":"","type":"array_object","name":"routes"},{"_id":"57a06f4c19a5850e0096a9f1","ref":"","in":"body","required":true,"desc":"An array of new jobs to be added to the given routes. Can be up to 10 jobs.","default":"","type":"array_object","name":"newJobs"},{"_id":"57a075320c933e0e00249bc5","ref":"","in":"header","required":false,"desc":"An API key.","default":"","type":"string","name":"x-api-key"}],"url":"/online"},"isReference":false,"order":0,"body":"","excerpt":"Solve an already-solved problem with an additional job","slug":"online","type":"endpoint","title":"/online"}

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 }}