Overview | Group | Tree | Graph | Index | Concepts |
An instance of the class IlcUnaryResource
represents a
discrete resource with capacity one.
As with discrete resources, there are two methods to take into account the constraints concerning the requirement of a unary resource. For reasons of efficiency, both methods specialize the methods of discrete resources.
In fact, that second method automatically updates the earliest
and latest start and end times of activities by means of that posted global,
disjunctive constraint. When using the second method, you can increase the
level of propagation in a similar way as for discrete resources with the
member function IlcDiscreteResource::setEdgeFinder
.
The second method (of dealing only with requiring activities) allows you to define transitiontimes between any two activities that require the same unary resource. Given two activities A1 and A2, the transition time between A1 and A2 is an amount of time that must elapse between the end of A1 and the beginning of A2 when A1 precedes A2. The member function IlcResource::getTransitionTime returns the transition time between two activities that require the resource under consideration (that is, the invoking resource). See Transition Time in Scheduler Engine.
Sequence Constraints
Since a unary resource can only process one activity at a time, all activities requiring the same unary resource must be chronologically ordered to find a solution. As a result, in any solution to a problem that includes a unary resource, each unary resource defines a directed path through all the activities requiring it.
The nodes of such a path correspond to resource constraints of the time
extent IlcFromStartToEnd
. The links between
the resource constraints can hold transition costs. See IlcTransitionCostObject
for more details.
The path has, for its first node, a virtual node before any activities. The link between this first node and the first activity on the resource holds the setup cost. This first activity is called the setup activity.
The path also has, for its last node, a virtual node after all activities. The link between this last node and the last activity on the resource holds the teardown cost. This last activity is called the teardown activity.
Because the path has a directed cost, there are two possible orientations for calculating a transition cost: between a node and the set of its possible successors or between a node and the set of its possible predecessors.
In first case, the variable cost of a node is calculated between the virtual setup node and the set of possible setup activities, and between an activity and the set of its possible following activities. There is no teardown cost.
In the second case, the variable cost of a node is calculated between an activity and the set of its possible preceding activities, and between the virtual teardown node and the set of possible teardown activities. There is no setup cost.
Printing or Displaying Unary Resources
The printed representation of an instance of the class
IlcUnaryResource
consists of its name followed its capacity,
which is 1, enclosed in brackets.
If the Solver trace is active and the resource is not named, the string
"IlcUnaryResource"
is followed by the address of the
implementation object. The address will be enclosed in parentheses.
For more information, see the concepts Disjunctive Constraint, Edge Finder, Ranking , Sequence Constraint, Timetable, Transition Cost (Setup and Teardown Costs) In Scheduler Engine, and Transition Time in Scheduler Engine.
See Also:
IlcDiscreteResource, IlcIntTimetable, IlcRank, IlcResource, IlcTransitionCostObject, IlcUnaryResourceIterator
Constructor Summary | |
---|---|
public | IlcUnaryResource() |
public | IlcUnaryResource(IlcUnaryResourceI * impl) |
public | IlcUnaryResource(IlcSchedule schedule, IlcBool disjunctive=IlcTrue) |
public | IlcUnaryResource(IlcSchedule schedule, IlcTransitionTimeObject ttobj, IlcBool disjunctive=IlcTrue) |
Method Summary | |
---|---|
public IlcUnaryResourceI * | getImpl() const |
public IlcConstraint | getSequenceConstraint() const |
public IlcResourceConstraint | getSetupRC() const |
public IlcResourceConstraint | getTeardownRC() const |
public IlcResourceConstraint | getVirtualNodeRC() const |
public IlcBool | hasSequenceConstraint() const |
public IlcBool | hasSetupRC() const |
public IlcBool | hasTeardownRC() const |
public IlcBool | isRanked() const |
public IlcBool | isSequenced() const |
public void | operator=(const IlcUnaryResource & h) |
Constructor Detail |
---|
This constructor creates a new instance of IlcUnaryResource
and adds it to the set of resources managed in the given
schedule
. The capacity of the resource is 1 (one). The argument
disjunctive
indicates whether the disjunctive constraint should
be posted.
This constructor creates a new instance of IlcUnaryResource
and adds it to the set of resources managed in the given
schedule
. The capacity of the resource is 1 (one). The argument
ttobj
indicates which transition time function will be used for
the invoking resource. The argument disjunctive
indicates
whether the disjunctive constraint should be posted.
Transition times are taken into account when the disjunctive constraint or the type timetable constraint is posted. If both constraints are posted, transition times will be taken into account only by the disjunctive constraint.
If the argument ttobj
has not been built with an instance of
IlcTransitionTable
, the type timetable
constraint will be unable to take transition times into account. See
Transition Time in Scheduler Engine
and
Type Timetable Constraint
for more information.
Method Detail |
---|
This member function returns the sequence constraint attached to the resource, if it exists.
This member function returns the resource constraint required by the
setup activity of the invoking resource. This member function should be
called only if some rank information is available on the resource (see
member function IlcResource::hasRankInfo
).
This member function returns the resource constraint required by the
teardown activity of the invoking resource. This member function should be
called only if some rank information is available on the resource (see
member function IlcResource::hasRankInfo
).
This member function returns the sequence virtual node of the
invoking unary resource. The sequence virtual node of a unary
resource is an automatically created resource constraint that do not affect the
availability of the resource and that is used in the sequence goals
and selectors to represent the virtual initial (in case of a
chronological sequence goal like IlcSequence
)
or final (in case of an anti-chronological sequence goal like
IlcSequenceBackward
) resource
constraint in the sequence of resource constraints of the unary resource .
This member function returns IlcTrue
if a sequence
constraint is attached on the invoking resource. Otherwise it returns
IlcFalse
.
This member function returns IlcTrue
if the setup activity
of invoking resource is known. Otherwise it returns IlcFalse
.
This member function should be called only if some rank information is
available on the resource (see member function IlcResource::hasRankInfo
).
This member function returns IlcTrue
if the invoking
resource has a teardown activity. Otherwise it returns
IlcFalse
. This member function should be called only if some
rank information is available on the resource (see member function
IlcResource::hasRankInfo
).
This member function returns IlcTrue
if all resource
constraints defined on the invoking resource have been ranked. Otherwise, it
returns IlcFalse
. This member function should be
called only if some rank information is available on the resource (see
member function IlcResource::hasRankInfo
).
This member function returns IlcTrue
if the invoking
resource is sequenced. That is, if each visited activity has a predecessor
(or is the setup activity) and a successor (or is the teardown activity).
Otherwise it returns IlcFalse
.