Overview | Group | Tree | Graph | Index | Concepts |
This function creates and returns a goal that ranks all resource constraints on a set of resources in 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 minimal value
at the end of the search.The resource constraint selector rcSel
selects the
next resource constraint to be ranked first on a given resource
given as first context to the selection function. By default, that
is, when no
IloSelector<IlcResourceConstraint,IlcResource>
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(IlcResourceConstraintPossibleFirstPredicate(s)); sel.setComparator(IlcLexicalComposition(IlcCompareMin(IlcActivityStartMinEvaluator(s)<<ac), IlcCompareMin(IlcActivityStartMaxEvaluator(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(IlcRankResource, IlcResource, resource, IloSelector<IlcResourceConstraint,IlcResource>, rcSel) { IlcResourceConstraint constraint; if (rcSel.select(constraint, resource)) return IlcAnd(IlcTryRankFirst(constraint), this); return 0; }
Here's how we could define the goal returned by the second version of the function:
ILCGOAL3(IlcRankSchedule, IlcSchedule, schedule, IloSelector<IlcResource,IlcSchedule>, rSel, IloSelector<IlcResourceConstraint,IlcResource>, rcSel) { IlcResource resource; if (rSel.select(resource, schedule)) return IlcAnd(IlcRank(resource, rcSel), this); return 0; }
See IloSelector
in the IBM ILOG Solver Reference Manual for more information.
See Also:
IlcSchedule, IlcResource, IlcTryRankFirst