0

I'm using https://wse.api.here.com/2/findsequence.json

Here is my request parameters:

mode=fastest;car;traffic:disabled&departure=2019-10-10T15:39:28+03:00

And here is the body:

destination4=4;38.792417,-77.30097;acc:th00:00:00+03:00|fr00:00:00+03:00;st:180
&destination5=5;38.792344,-77.299805;before:destination4;acc:th00:00:00+03:00|th19:00:00+03:00;st:180&start=user;38.776573,-77.275411&destination7=7;38.804577,-77.279514;before:destination5;acc:th00:00:00+03:00|fr00:00:00+03:00;st:180

That's what i have in the response:

{"results":[{"waypoints":[{"id":"user","lat":38.776573,"lng":-77.275411,"sequence":0,"estimatedArrival":null,"estimatedDeparture":"2019-10-10T14:09:49+03:00","fulfilledConstraints":[]},{"id":"5","lat":38.792344,"lng":-77.299805,"sequence":1,"estimatedArrival":"2019-10-10T14:15:44+03:00","estimatedDeparture":"2019-10-10T14:18:44+03:00","fulfilledConstraints":["acc:th00:00:00+03:00|fr19:00:00+03:00;st:180","before:destination4"]},{"id":"4","lat":38.792417,"lng":-77.30097,"sequence":2,"estimatedArrival":"2019-10-10T14:19:21+03:00","estimatedDeparture":"2019-10-10T14:22:21+03:00","fulfilledConstraints":["acc:th00:00:00+03:00|fr00:00:00+03:00;st:180"]},{"id":"7","lat":38.804577,"lng":-77.279514,"sequence":3,"estimatedArrival":"2019-10-10T14:28:19+03:00","estimatedDeparture":null,"fulfilledConstraints":["acc:th00:00:00+03:00|fr00:00:00+03:00;st:180","before:destination5"]}],"distance":"7548","time":"1290","interconnections":[{"fromWaypoint":"user","toWaypoint":"5","distance":3626.0,"time":355.0,"rest":0.0,"waiting":0.0},{"fromWaypoint":"5","toWaypoint":"4","distance":191.0,"time":37.0,"rest":0.0,"waiting":0.0},{"fromWaypoint":"4","toWaypoint":"7","distance":3731.0,"time":358.0,"rest":0.0,"waiting":0.0}],"description":"Targeted best distance; without traffic","timeBreakdown":{"driving":750,"service":540,"rest":0,"waiting":0}}],"errors":[],"processingTimeDesc":"78ms","responseCode":"200","warnings":null,"requestId":null}

As you can see i have before constraint in destination7 and destination5 but it's ignored. Am i doing smth wrong?

Airn5475
  • 2,452
  • 29
  • 51
Alex Koba
  • 327
  • 3
  • 9

1 Answers1

1

You have these waypoints: start, destination4, destination5 and destination7 with constraints: destination5 before destination4 and destination7 before destination5. Now you did not specify an end waypoint so the algorithm chose one of waypoints as the end waypoint for optimal results (in this case destination7 was chosen as the end waypoint which then overrode the constraint). Please specify an end waypoint and the other constraints will be satisfied. Reference from documentation:

destinationN: Intermediate destinations, at least one. If no end parameter is provided, one of these values is selected as end of the sequence.

https://developer.here.com/documentation/mobility-on-demand-toolkit/topics/determining-optimal-delivery-sequence.html

  • Nope. Adding `end` doesn't help. Request: `destination1=1;38.792859,-77.316802;before:destination7;st:180&start=user;38.776573,-77.275411&end=4;38.792417,-77.30097;st:180&destination7=7;38.804577,-77.279514;acc:sa00:00:00+03:00|su00:00:00+03:00;st:180` Response: https://pastebin.com/VMHyPPvG – Alex Koba Oct 12 '19 at 17:02