Ready/due ignored when feasible = true


#1

Edit: this description of the problem is outdated; see my 2nd post. Ready/due values seem to be mostly ignored for me apart from the weird occurrence described below I haven’t been able to get it to work:

Using the v2 API I wanted to revisit my home depot somewhere around the evening, so I added another entry in the locations list with “ready” and “due” parameters. However, it seems to ignore specifically the ready and due parameters and just immediatly visits the home depot twice at the start of the route:

node_id,lat,lng,arrival,distance
99999,51.162978,4.1415526,0,0.0
99999,51.163878,4.1416526,10,0.0
3437,51.2078344,4.07736,119,7.7
....

Look specifically at the 2nd last column: ‘arrival’ (0min-10min-119min). It does take into account the 100 minutes servicetime that I specified for the 2nd visit but it ignores the ready and due constraints:

{"address": 99992, "lat": 51.1338804, "lng": 4.5669902, "servicetime": 100, "ready": 435, "due": 465}

I’ve tried:

  • Giving it a larger window of time.
  • Giving it slightly different lat/lng than the first home depot node
  • Giving at a higher service time to make sure it was applying at least some option set in the json object

None of these matters and it only takes into account the ready/due parameters if I give the second visit a different label (here 10000):

99999,51.162978,4.1415526,0,0.0
3437,51.2078344,4.07736,19,7.7
...
100000,51.162988,4.1415626,464,77.4

I can work around it but it still seems like unintended behaviour and poses some problems for me as the label is an id that I use, could this be fixed?


#2

Ok so bit of an update: the ready/due parameters are for me 90% of the time ignored and don’t seem to behave the way I think they do, could somebody explain their intended behaviour?

I’d expect that:

  • When the response contains “feasible”: true that all ready and due constraints are met succesfully and so:
  • A location with a ‘ready’ value X is then visited later than X minutes into the tour.
  • A location with a ‘due’ value X is visited earlier than X minutes into the tour.
  • A location with both values is visited after ready and before due

Right now I’m getting feasible: true responses where it has ignored all of the ready/due restrictions … :confused: For random nodes, even aside from what I first thought only to occur with same address nodes.


#3

Can you try with the ready and due times in an array “restrictions”?

E.g. see Definition of ready and due in api

or https://github.com/routexl/RouteXL-API-Connector/blob/master/Javascript/index.html


#4

Ok, thanks for clearing that up, I’ve been on a wild goose hunt! I do find the API documentation lacking. Something like Swagger, a Postman collection, or just any modern documentation tool can generate automatic examples based on a few docstrings and they do help out alot and prevent confusion when implementing an interface for your API.

The way the blog post describes it “any location can have restrictions”, followed by a list of restrictive conditions, makes it sound very natural that any location, an item in the locations array, can contain some of these restrictions as a direct child. It doesn’t point to the existence of a seperate restrictions array.


#5

The documentation can definitely be improved indeed. Most developers seem to understand and find their way, with the examples and all, but you’re totally right that it lacks.