FRAMES NO FRAMES

IlcAssignAlternative

public IlcGoal IlcAssignAlternative(IlcAltResSet resources, IloSelector< IlcResource, IlcAltResConstraint > possibleSel=0, IloSelector< IlcAltResConstraint, IlcAltResSet > constraintSel=0)
public IlcGoal IlcAssignAlternative(IlcSchedule schedule, IloSelector< IlcResource, IlcAltResConstraint > possibleSel=0, IloSelector< IlcAltResConstraint, IlcAltResSet > constraintSel=0)
public IlcGoal IlcAssignAlternative(IlcResource resource, IloSelector< IlcAltResConstraint, IlcAltResSet > constraintSel=0)
Definition file: ilsched/srchalt.h
Include file: <ilsched/search.h>

This function returns a goal that assigns a possible resource as the selected one for a set of constraints.

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: