Failing to apply visit order, when a certain condition is met #2973
Unanswered
GuyBenhaim
asked this question in
Routing (and legacy CP) questions
Replies: 1 comment
-
I needed to add conditions for ActiveVar. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I need to force a vehicle's visit order to two Nodes (Condition B) when another condition
(Condition A) is met. Condition B simply requires that one Node is always visited before the other Node, based-on the accumulated number of visits by the vehicle: Visits(Node1) < Visits(Node2).
I hoped this would force B valid when A is valid (and ignore B when A is invalid):
model.solver().Add( model.solver().MakeConditionalExpression(A == 1, B, 1) == 1);
However, the solver just totally skips these two Nodes, and ignores this. How can the condition over the accumulated number of visits be satisfied when both thee Nodes are not active?
Any tips?
Beta Was this translation helpful? Give feedback.
All reactions