Overview | Group | Tree | Graph | Index | Concepts |
This function creates and returns a goal that ranks all resource constraints on a set of resources in anti-chronological order.
IlcResource
, it considers all the resource
constraints on that instance of IlcResource
. IlcSchedule
, it considers all the resource
constraints on instances of IlcResource
in that schedule. The resource
selector rSel
selects the next resource. By default,
that is, when no resource selector object is given, a resource
selector defaultResSel
defined as follows is
used:IloSelector<IlcResource,IlcSchedule> defaultResSel = IlcResourceInScheduleSelector(s); sel.setPredicate(IlcResourceIsUnaryResourcePredicate(s) && !IlcResourceRankedPredicate(s)); sel.setComparator(IlcResourceGlobalSlackEvaluator(s));
criterion
is given, then this
variable will be bound, if possible, to its maximal value
at the end of the search.The resource constraint selector rcSel
selects the
next resource constraint to be ranked last on a given resource
given as first context to the selection function. By default, that
is, when no
IloSelector<IlcResourceConstraint>
is given, a resource constraint selector defaultRCSel
defined as follows is used:
IloSelector<IlcResourceConstraint,IlcResource> defaultRCSel = IlcResourceConstraintInScheduleSelector(s); IlcTranslator<IlcActivity, IlcResourceConstraint> ac = IlcActivityResourceConstraintTranslator(s); sel.setPredicate(IlcResourceConstraintPossibleLastPredicate(s)); sel.setComparator(IlcLexicalComposition(IlcCompareMax(IlcActivityEndMaxEvaluator(s)<<ac), IlcCompareMax(IlcActivityEndMinEvaluator(s)<<ac)));
Ranking is only well defined on unary and state resources.
Therefore, your resource selector should contain an instance of
IlcResourceIsUnaryResourcePredicate
or
IlcResourceIsStateResourcePredicate
(or both, joined by a logical-OR).
Implementation
Here's how we could define the goal returned by the first version of the function.
ILCGOAL2(IlcRankBackwardResource, IlcResource, resource, IloSelector<IlcResourceConstraint,IlcResource>, rcSel) { IlcResourceConstraint constraint; if (rcSel.select(constraint, resource)) return IlcAnd(IlcTryRankLast(constraint), this); return 0; }
Here's how we could define the goal returned by the second version of the function:
ILCGOAL3(IlcRankBackwardSchedule, IlcSchedule, schedule, IloSelector<IlcResource,IlcSchedule>, rSel, IloSelector<IlcResourceConstraint,IlcResource>, rcSel) { IlcResource resource; if (rSel.select(resource, schedule)) return IlcAnd(IlcRankBackward(resource, rcSel), this); return 0; }
See IloSelector
in the IBM ILOG Solver Reference Manual for more information.
See Also:
IlcSchedule, IlcResource, IlcTryRankLast