Overview | Group | Tree | Graph | Index | Concepts |
A goal can be defined in terms of other goals, called its subgoals. The
function IlcAnd
creates a goal composed of a sequence of other goals
(between two and five subgoals). Executing this goal executes the subgoals from left to
right. That apparent limitation of five subgoals can be overcome by several calls to the
function, since IlcAnd
is associative.
If a goal is null (that is, if its implementation is null), it will be silently ignored.
Examples:
First we'll define a goal, PrintX
, like this:
ILCGOAL1(PrintX, IlcInt, value){ IloSolver s = getSolver(); s.out() << "PrintX: a goal with one data member" << endl; s.out() << value << endl; return 0; }
Then the following statements:
s.solve(IlcAnd(PrintX(1), PrintX(2), PrintX(3));
produce the following output:
PrintX: executing a goal with one data member 1 PrintX: executing a goal with one data member 2 PrintX: executing a goal with one data member 3
Here's how to define a choice point with eight subgoals:
IlcAnd(IlcAnd(g1, g2, g3, g4, g5), IlcAnd(g6, g7, g8));
For more information, see the concept Goal.
See Also: