Difference between AVOID and FORBID
Posted: Mon May 04, 2015 1:38 pm
Hello together,
today I discussed the difference between AVOID segments and FORBID segments with a customer. His application will show a checkbox labeled as "AVOID FERRIES" and he wants to know how to match the checkbox state to parameter values.
Well, a close look at the API offers at least the following matchings (C# syntax):
Best regards Bernd
today I discussed the difference between AVOID segments and FORBID segments with a customer. His application will show a checkbox labeled as "AVOID FERRIES" and he wants to know how to match the checkbox state to parameter values.
Well, a close look at the API offers at least the following matchings (C# syntax):
- string AVOID_FERRIES = (checkbox.checked) ? ("BAN"):("0");
with this approach the checkbox will definetly cause detours and the black/white "a ferry won't ever appear in the result" whenever the the box is checked. Worst case: if start and destination are located on two different islands and the only connection is a ferry, the checked box will cause an error because the given task is not possible to be solved. - string AVOID_FERRIES = (checkbox.checked) ? "2500" : "0";
With this approach routings will usually return ferry-free results but under some special conditions (see the 2islands from above or the next bridge crossing the river is very far away) a ferry may appear in the result. This parametrizing pattern is not strictly black/white and is therefore more flexible.
Best regards Bernd