You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My intent when parsing json what to ensure all vehicles either have no capacity key, or have all the same length for the capacity array. In particular I expect a missing capacity array to trigger an error. This happens for example when using:
resulting in an error with the message "Inconsistent capacity length: 1 and 0."
So far so good, but I just found out that reversing the order of vehicles above changes the behavior: we no longer get an error, instead the capacity for vehicle with id 0 is considered as zero and we move on with solving.
In this situation the vehicle won't get a route assigned if all tasks have a non-zero demand, so this is not such a big problem if considering that no capacity key means zero capacity.
Yet I think we should change this because:
it would be more consistent to enforce always explicitly providing a capacity array as initially intended;
it is clearer to get an error in the first place than to have to debug why those vehicles do not get routes (the reason I stumbled upon this);
getting either a "usual" solution or an error just by changing vehicle order in input is not really acceptable.
The text was updated successfully, but these errors were encountered:
In practice, this happens because we use the length of the capacity for the first vehicle as the reference for amount lengths, assuming consistency but not enforcing it if the key is absent.
My intent when parsing json what to ensure all vehicles either have no
capacity
key, or have all the same length for thecapacity
array. In particular I expect a missingcapacity
array to trigger an error. This happens for example when using:resulting in an error with the message "Inconsistent capacity length: 1 and 0."
So far so good, but I just found out that reversing the order of vehicles above changes the behavior: we no longer get an error, instead the capacity for vehicle with id
0
is considered as zero and we move on with solving.In this situation the vehicle won't get a route assigned if all tasks have a non-zero demand, so this is not such a big problem if considering that no
capacity
key means zero capacity.Yet I think we should change this because:
capacity
array as initially intended;The text was updated successfully, but these errors were encountered: