FRAMES NO FRAMES

IlcGoalFail

public IlcGoal IlcGoalFail(IloSolver solver, IlcAny label=0)
Definition file: ilsolver/basic.h
Include file: <ilsolver/ilosolver.h>

The function IlcGoalFail calls IloSolver::fail(label) in its body. Thus it always fails.

Example

This function can be used to search for all possible ways to execute a goal. The idea is to try all possible subgoals of all choice points by calling IlcGoalFail after each successful goal execution. Then Solver backtracks and searches for another execution.

Thus if the statements


 solver.solve(IlcGoal);

search for one successful execution of the goal, goal, then the statement


 solver.solve(IlcAnd(goal, IlcGoalFail(solver)));

search for all possible executions of goal.

See Also: