| Overview | Group | Tree | Graph | Index | Concepts |
This function returns a goal that assigns a possible resource as the selected one for a set of constraints.
IlcAltResSet, it considers all the constraints on
that instance of IlcAltResSet.IlcSchedule, it considers all the constraints on
instances of IlcAltResSet in that schedule.IlcResource, it considers all the constraints on
instances of IlcAltResSet for which that resource is a possible
alternative.The goal uses the resource selector possibleSel to
choose the resource and the alternative resource constraint selector
constraintSel to choose a constraint. If no argument of type
IloSelector<IlcResource,IlcAltResConstraint> is given, the goal
uses a default selector, which tries the resources in the same order
as an instance of IlcPossibleAltResIterator. If no argument of
type IloSelector<IlcAltResConstraint,IlcAltResSet> is given, the
goal uses a default selector, which tries the posted or metaposted
alternative resources constraints in the same order as an instance of
IlcAltResConstraintIterator.
Implementation
This function can be defined like this:
IlcGoal IlcAssignAlternative
(IlcAltResSet resources,
IloSelector<IlcResource,IlcAltResConstraint> possibleSel,
IloSelector<IlcAltResConstraint,IlcAltResSet> constraintSel) {
IlcAltResConstraint alternative;
if (constraintSel.select(alternative, resources))
return IlcAnd(IlcAssign(alternative, possibleSel),
IlcAssignAlternative(resources,
possibleSel,
constraintSel));
return 0;
}See IloSelector in the IBM ILOG Solver Reference Manual for more information.
See Also:
IlcAltResConstraint, IlcAltResSet, IlcAssign, IlcResource, IlcSchedule