FRAMES NO FRAMES

Class IlcUnaryResource

Definition file: ilsched/unary.h
Include file: <ilsched/ilsched.h>

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:

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 IlcConstraintgetSequenceConstraint() const
public IlcResourceConstraintgetSetupRC() const
public IlcResourceConstraintgetTeardownRC() const
public IlcResourceConstraintgetVirtualNodeRC() const
public IlcBoolhasSequenceConstraint() const
public IlcBoolhasSetupRC() const
public IlcBoolhasTeardownRC() const
public IlcBoolisRanked() const
public IlcBoolisSequenced() const
public voidoperator=(const IlcUnaryResource & h)
Inherited Methods from IlcDiscreteResource
getCapacity, getCapacityMax, getCapacityMaxMax, getCapacityMaxMin, getCapacityMin, getCapacityMinMax, getCapacityMinMin, getGlobalSlack, getImpl, getLocalSlack, getTypeTimetableConstraint, hasTypeTimetableConstraint, makeDisjunctiveConstraint, makeTypeTimetableConstraint, operator=, setCapacityMax, setCapacityMin, setEdgeFinder, setPrecedencePropagation, setTimetablePropagation, storeSufficientDirectSuccessors
Inherited Methods from IlcCapResource
getImpl, getMaxTextureMeasurement, getMinTextureMeasurement, getTimetable, getTimetable, hasInitialOccupation, hasMaxTextureMeasurement, hasMinTextureMeasurement, incrDurableRequirement, incrDurableRequirement, isRedundantResource, makeBalanceConstraint, makeMaxTextureMeasurement, makeMinTextureMeasurement, makeTimetableConstraint, makeTimetableConstraint, makeTimetableConstraint, operator=, setInitialOccupation, setInitialOccupation, unsetInitialOccupation
Inherited Methods from IlcResource
close, getCalendar, getDisjunctiveConstraint, getDurableSchedule, getImpl, getLastRankedFirstRC, getLastRankedLastRC, getLastSurelyContributingRankedFirstRC, getLastSurelyContributingRankedLastRC, getName, getObject, getOldLastRankedFirstRC, getOldLastRankedLastRC, getPrecedenceGraphConstraint, getSchedule, getSolver, getSolverI, getTimetableConstraint, getTransitionTime, hasCalendar, hasDisjunctiveConstraint, hasLightPrecedenceGraphConstraint, hasPrecedenceGraphConstraint, hasPrecedenceInfo, hasRankInfo, hasTimetableConstraint, isCapacityResource, isClosed, isContinuousReservoir, isDiscreteEnergy, isDiscreteResource, isDurable, isReservoir, isStateResource, isTransitionTimeSuspended, isUnaryResource, makeFunctionalConstraint, makeIntegralConstraint, makeLightPrecedenceGraphConstraint, makePrecedenceGraphConstraint, operator!=, operator=, operator==, setCalendar, setName, setObject, setTransitionTimeObject, setTransitionTimeSuspended, whenContribution, whenDirectPredecessors, whenDirectSuccessors, whenNext, whenPossibleNext, whenPossiblePrevious, whenPredecessors, whenPrevious, whenRankedFirstRC, whenRankedLastRC, whenSuccessors
Constructor Detail

IlcUnaryResource

public IlcUnaryResource()
This constructor creates an instance which is empty, that is, one whose handle pointer is null. You must assign it a value before you access it. Any attempt to access it before assignment leads to undefined behaviour.

IlcUnaryResource

public IlcUnaryResource(IlcUnaryResourceI * impl)
This constructor creates an instance of the handle class from the pointer to an instance of the implementation class.

IlcUnaryResource

public IlcUnaryResource(IlcSchedule schedule, IlcBool disjunctive=IlcTrue)

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.


IlcUnaryResource

public IlcUnaryResource(IlcSchedule schedule, IlcTransitionTimeObject ttobj, IlcBool disjunctive=IlcTrue)

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

getImpl

public IlcUnaryResourceI * getImpl() const
This member function returns a pointer to the implementation object of the invoking handle.

getSequenceConstraint

public IlcConstraint getSequenceConstraint() const

This member function returns the sequence constraint attached to the resource, if it exists.


getSetupRC

public IlcResourceConstraint getSetupRC() const

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).


getTeardownRC

public IlcResourceConstraint getTeardownRC() const

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).


getVirtualNodeRC

public IlcResourceConstraint getVirtualNodeRC() const

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 .


hasSequenceConstraint

public IlcBool hasSequenceConstraint() const

This member function returns IlcTrue if a sequence constraint is attached on the invoking resource. Otherwise it returns IlcFalse.


hasSetupRC

public IlcBool hasSetupRC() const

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).


hasTeardownRC

public IlcBool hasTeardownRC() const

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).


isRanked

public IlcBool isRanked() const

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).


isSequenced

public IlcBool isSequenced() const

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.


operator=

public void operator=(const IlcUnaryResource & h)
This operator assigns an address to the handle pointer of the invoking object. That address is the location of the implementation object of the provided argument. After execution of this operator, the invoking object and the provided argument point to the same implementation object.