FRAMES NO FRAMES

Class IlcCapResource

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

IlcCapResource is the root class for capacity resources, that is, resources that are defined to have a limited integer capacity over time. In the Scheduler Engine, there are the following classes of capacity resources:

Closing a Resource

The inherited member function IlcResource::close specifies that all the activities requiring or providing the invoking resource are known; that is, they have been linked to the resource. This information allows additional constraint propagation to take place, for example, the propagation of minimal capacity constraints. Propagating minimal capacity constraints is particularly useful in the case of resource allocation problems for which some minimal amount of provided capacity must be reached. With such information, indeed, the system can eliminate situations in which minimal capacity amounts cannot be reached using only the activities already defined.

An instance of IloSolver::SolverErrorException is thrown if you attempt to add a new requiring or providing activity to a capacity resource that has been closed.

Initial Occupation

The timetable of the resource represents the occupation of the resource by activities. Scheduler Engine offers a way to set up the initial occupation without having to declare the corresponding activities.

That facility is intended to help in solving a problem by iteratively adding a new set of activities to schedule or in improving a solution by rescheduling a subset of the activities.

For discrete resources, that is for instances of IlcDiscreteResource, IlcDiscreteEnergy, and IlcReservoir, the initial occupation is defined with an instance of the IlcIntToIntStepFunction class. For continuous reservoirs, that is instances of IlcContinuousReservoir, the initial occupation is defined with an instance of the IlcIntToFloatSegmentFunction class. The value of the stepwise or piecewise linear function at an integer point in time is considered as the sum of the requirements of fictitious or previously constructed activities.

For instances of IlcDiscreteResource and IlcDiscreteEnergy, the initial level is zero outside the definition domain of the function.

For instances of IlcReservoir and IlcContinuousReservoir, if the definition domain of the function intersects the temporal interval of the time table, the initial level is given by the function on its definition domain, and by zero elsewhere. That is, Scheduler Engine ignores the initial level of the reservoir. If the definition domain of the function does not intersect the temporal interval of the time table, the initial level of the reservoir is used as usual.

Note
The content of the function is stored by copy in the resource. Any modifications to the function after it is copied will not be seen by the timetables of the resource.

For more information, see Timetable, Disjunctive Constraint, and in the IBM ILOG Solver Reference Manual, IlcIntToIntStepFunction.

See Also:

Constructor Summary
public IlcCapResource()
public IlcCapResource(IlcCapResourceI * impl)
Method Summary
public IlcCapResourceI *getImpl() const
public IlcResourceTexturegetMaxTextureMeasurement() const
public IlcResourceTexturegetMinTextureMeasurement() const
public IlcIntTimetablegetTimetable() const
public IlcIntTimetablegetTimetable(IlcInt time) const
public IlcBoolhasInitialOccupation() const
public IlcBoolhasMaxTextureMeasurement() const
public IlcBoolhasMinTextureMeasurement() const
public voidincrDurableRequirement(IlcIntToIntStepFunction func)
public voidincrDurableRequirement(IlcInt t1, IlcInt t2, IlcInt cap, IlcBool inward, IlcInt db)
public IlcBoolisRedundantResource() const
public IlcConstraintmakeBalanceConstraint()
public IlcResourceTexturemakeMaxTextureMeasurement(IlcRCTextureFactory=0, IlcTextureCriticalityCalculator=0)
public IlcResourceTexturemakeMinTextureMeasurement(IlcRCTextureFactory=0, IlcTextureCriticalityCalculator=0)
public IlcConstraintmakeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcInt timeStep, IlcInt capacity)
public IlcConstraintmakeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcInt timeStep)
public IlcConstraintmakeTimetableConstraint(IlcInt timeStep=1)
public voidoperator=(const IlcCapResource & h)
public voidsetInitialOccupation(IlcIntToFloatSegmentFunction func)
public voidsetInitialOccupation(IlcIntToIntStepFunction func)
public voidunsetInitialOccupation()
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

IlcCapResource

public IlcCapResource()
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.

IlcCapResource

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

Method Detail

getImpl

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

getMaxTextureMeasurement

public IlcResourceTexture getMaxTextureMeasurement() const

This member function returns the texture measurement associated with the maximum constraint of the invoking resource. If no texture measurement has been associated with the maximum constraint of the invoking resource, an empty handle is returned.


getMinTextureMeasurement

public IlcResourceTexture getMinTextureMeasurement() const

This member function returns the texture measurement associated with the minimum constraint of the invoking resource. If no texture measurement has been associated with the minimum constraint of the invoking resource, an empty handle is returned.


getTimetable

public IlcIntTimetable getTimetable() const

This member function returns the first timetable of the invoking resource (first in chronological order). An instance of IloSolver::SolverErrorException is thrown is no timetable exists for the invoking resource. The invoking resource must not be a continuous reservoir.


getTimetable

public IlcIntTimetable getTimetable(IlcInt time) const

This member function returns the timetable that includes time. An instance of IloSolver::SolverErrorException is thrown if no timetable is defined at time. The invoking resource must not be a continuous reservoir.


hasInitialOccupation

public IlcBool hasInitialOccupation() const

This member function returns IlcTrue if an initial occupation has been set up on the invoking resource. Otherwise, it returns IlcFalse.

Initial Occupation

The timetable of the resource represents the occupation of the resource by activities. Scheduler Engine offers a way to set up the initial occupation without having to declare the corresponding activities.

That facility is intended to help in solving a problem by iteratively adding a new set of activities to schedule or in improving a solution by rescheduling a subset of the activities.

For discrete resources, that is instances of IlcDiscreteResource, IlcDiscreteEnergy, and IlcReservoir, the initial occupation is defined with an instance of the IlcIntToIntStepFunction class. For continuous reservoirs, that is instances of IlcContinuousReservoir, the initial occupation is defined with an instance of the IlcIntToFloatSegmentFunction class. The value of the stepwise or piecewise linear function at an integer point in time is considered as the sum of the requirements of fictitious or previously constructed activities.

For instances of IlcDiscreteResource and IlcDiscreteEnergy, the initial level is zero outside the definition domain of the function.

For instances of IlcReservoir and IlcContinuousReservoir, if the definition domain of the function intersects the temporal interval of the time table, the initial level is given by the function on its definition domain, and by zero elsewhere. That is, Scheduler Engine ignores the initial level of the reservoir. If the definition domain of the function does not intersect the temporal interval of the time table, the initial level of the reservoir is used as usual.

Note
The content of the function is stored by copy in the resource. Any modifications to the function after it is copied will not be seen by the timetables of the resource.

hasMaxTextureMeasurement

public IlcBool hasMaxTextureMeasurement() const

This member function returns IlcTrue if a texture measurement has been created on the maximum constraint of the invoking resource. Otherwise, it returns IlcFalse.


hasMinTextureMeasurement

public IlcBool hasMinTextureMeasurement() const

This member function returns IlcTrue if a texture measurement has been created on the minimum constraint of the invoking resource. Otherwise, it returns IlcFalse.


incrDurableRequirement

public void incrDurableRequirement(IlcIntToIntStepFunction func)

The purpose of this function is to provide a non-reversible, non-monotonic edition of the requirement amount of a durable resource. Refer to Durability for complete information on that subject.

This function modifies the requirement amount that corresponds to an activity starting a t1, ending at t2 and requiring the capacity of the argument capacity. This function is similar to having an activity on each step starting at t1, ending at t2 and of value capacity of the argument func.

If the argument capacity is greater than 0, the effect of the function is to add capacity to the amount of requirement to the resource on the interval [t1, t2); that is, to actually decrease the available capacity in the resource.

If the argument capacity is less than 0, the effect of the function is to remove capacity from the requirement amount of the resource on the interval [t1, t2); that is, to increase the available capacity in the resource.

In the case of a discrete resource timetable of timestep different from one, an instance of IloSolver::SolverErrorException is thrown if the function steps do not fit the timestep of the resource. In the case of energy with a break timetable, the equivalent activities are considered as being not breakable.

The coherency of the requirement amount with respect to the resource capacity is under the responsibility of the user. For example, one should be cautious that the requirements that are undone do not exceed the requirement of activities committed on the resource when a search using the durable resource is launched.

For a multi-threaded durable resource, these functions are enclosed in a critical section. That is, these functions are MT-hot.

An instance of IloSolver::SolverErrorException is thrown if the schedule is not durable, if the durable schedule is not closed, or if the resource is in used by a computational manager.


incrDurableRequirement

public void incrDurableRequirement(IlcInt t1, IlcInt t2, IlcInt cap, IlcBool inward, IlcInt db)

The purpose of this function is to provide a non-reversible, non-monotonic edition of the requirement amount of a durable resource. Refer to Durability for complete information on that subject.

This function modifies the requirement amount that corresponds to an activity starting a t1, ending at t2 and requiring the capacity of the argument cap.

If the argument cap is greater than 0, the effect of the function is to add cap to the amount of requirement to the resource on the interval [t1, t2); that is, to actually decrease the available capacity in the resource.

If the argument cap is less than 0, the effect of the function is to remove cap from the requirement amount of the resource on the interval [t1, t2); that is, to increase the available capacity in the resource.

The optional argument inward is used by discrete resource timetable constraints of a time step greater than one as the rounding policy for the equivalent activity. The optional argument db is used by energy with break timetable constraints as the duration of the breaks for the equivalent breakable activity (that is, end time - start time - processing time).

The coherency of the requirement amount with respect to the resource capacity is under the responsibility of the user. For example, one should be cautious that the requirements that are undone do not exceed the requirement of activities committed on the resource when a search using the durable resource is launched.

For a multi-threaded durable resources, these functions are enclosed in a critical section. That is, these functions are MT-hot.

An instance of IloSolver::SolverErrorException is thrown if the tuple [t1, t2, db) is invalid for defining an activity. An instance of IloSolver::SolverErrorException is thrown if the schedule is not durable, if the durable schedule is not closed, or if the resource is in used by a computational manager.


isRedundantResource

public IlcBool isRedundantResource() const

This method returns IlcTrue if the invoking IlcCapResource object was created as a redundant resource, using the method IlcAltResSet::makeRedundantResource. It returns IlcFalse otherwise.


makeBalanceConstraint

public IlcConstraint makeBalanceConstraint()

This member function creates a balance constraint on the invoking discrete resource or reservoir. This constraint allows a stronger propagation of the discrete resource capacity. See Balance Constraint for more information. That constraint must be posted in order to be taken into account.


makeMaxTextureMeasurement

public IlcResourceTexture makeMaxTextureMeasurement(IlcRCTextureFactory=0, IlcTextureCriticalityCalculator=0)

This member function creates an instance of IlcResourceTexture on the maximum constraint of the invoking resource. By default, that is, if not otherwise specified, the IlcRCTextureFactory used is an instance of IlcRCTextureProbabilisticFactoryI and the IlcTextureCriticalityCalculator used is an instance of IlcProbabilisticCriticalityCalculatorI.


makeMinTextureMeasurement

public IlcResourceTexture makeMinTextureMeasurement(IlcRCTextureFactory=0, IlcTextureCriticalityCalculator=0)

This member function creates an instance of IlcResourceTexture on the minimum constraint of the invoking resource. By default, that is, if not otherwise specified, the IlcRCTextureFactory used is an instance of IlcRCTextureProbabilisticFactoryI and the IlcTextureCriticalityCalculator used is an instance of IlcProbabilisticCriticalityCalculatorI.


makeTimetableConstraint

public IlcConstraint makeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcInt timeStep, IlcInt capacity)

This member function creates and returns a timetable constraint for the invoking resource. This timetable constraint implies that the capacity of the resource is limited to capacity from timeMin to timeMax and allowed to change only at times timeMin + i * timeStep. If the invoking resource is an instance of IlcDiscreteResource or IlcUnaryResource, capacity represents the maximal theoretical capacity. If the invoking resource is an instance of IlcDiscreteEnergy, capacity represents the maximal available energy.

An instance of IloSolver::SolverErrorException is thrown if any of the following conditions occur:


makeTimetableConstraint

public IlcConstraint makeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcInt timeStep)

This member function creates and returns a timetable constraint for the invoking resource. This timetable constraint implies that the capacity of the resource is limited to the theoretical capacity of the resource from timeMin to timeMax and allowed to change only at times timeMin + i * timeStep.

An instance of IloSolver::SolverErrorException is thrown if any of the following conditions occur:


makeTimetableConstraint

public IlcConstraint makeTimetableConstraint(IlcInt timeStep=1)

This member function creates and returns a timetable constraint for the invoking resource. This timetable constraint implies that the capacity of the resource is limited to the theoretical capacity of the resource from the time origin timeMin to the time horizon, and allowed to change only at times timeMin + i * timeStep.

An instance of IloSolver::SolverErrorException is thrown if any of the following conditions occur:


operator=

public void operator=(const IlcCapResource & 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.

setInitialOccupation

public void setInitialOccupation(IlcIntToFloatSegmentFunction func)

This member function sets the argument func as the initial level of the timetables of the invoking capacity resource. The invoking resource must be a continuous reservoir. The argument func is copied. The initial occupation is considered at post time of the timetable constraint. That is, a call to setInitialOccupation after the adding of the timetable constraint in the solver and the entering of the solver in search mode has no effect.

Refer to IlcCapResource::hasInitialOccupation for more information on initial occupation.


setInitialOccupation

public void setInitialOccupation(IlcIntToIntStepFunction func)

This member function sets the argument func as the initial level of the timetables of the invoking resource. The argument func is copied. The initial occupation is considered at post time of the timetable constraint. That is, a call to setInitialOccupation after the adding of the timetable constraint in the solver and the entering of the solver in search mode has no effect.

Refer to IlcCapResource::hasInitialOccupation for more information on initial occupation.


unsetInitialOccupation

public void unsetInitialOccupation()

This member function unsets the initial level of the timetables of the invoking resource. That is, the resource no longer has an initial occupation.

Refer to IlcCapResource::hasInitialOccupation for more information on initial occupation.