FRAMES NO FRAMES

Class IlcReservoir

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

An instance of the class IlcReservoir represents a resource for which activities can both provide capacity and also require capacity. You can define required and provided capacity so that the Scheduler Engine will insure that no more capacity is ever used than provided.

Furthermore, if you define a maximal level of the reservoir, then this maximal level will never be exceeded.

When the model of your problem represents an ongoing process, you may be faced with the fact that the reservoir already has some non-zero level. You can simply pass an initial level like that to the constructor of IlcReservoir.

The capacity of a reservoir can vary over time. You can define temporary maximal and minimal levels by using member functions of IlcReservoir.

Closing a Reservoir

The member function IlcResource::close is crucial for propagation affecting the class IlcReservoir. If IlcResource::close is not called, new activities providing or requiring capacity can still be added. This means that no propagation can take place before the reservoir is closed.

Printing or Displaying Reservoirs

The printed representation of an instance of the class IlcReservoir consists of its name, if it exists, and its theoretical capacity followed by its initial level. The two values are enclosed in brackets and separated by a dash (-). For example:

r1[100 - 10] represents the reservoir named r1 which has a capacity equal to 100 and an initial level equal to 10.

If the Solver trace is active and the resource is not named, the string “IlcReservoir” is followed by the address of the implementation object. The address will be enclosed in parentheses.

If the theoretical capacity of the reservoir is equal to its maximal value (that is IlcIntMax/2), the string Maximum Capacity is displayed instead of its numerical value.

For more information, see Timetable, and Balance Constraint.

See Also:

Constructor Summary
public IlcReservoir()
public IlcReservoir(IlcReservoirI * impl)
public IlcReservoir(IlcSchedule schedule, IlcInt capacity=IlcMaxCapacityReservoir, IlcInt initialLevel=OL, IlcBool timetable=IlcTrue)
Method Summary
public IlcIntgetCapacity() const
public IlcReservoirI *getImpl() const
public IlcIntgetInitialLevel() const
public IlcIntgetLevelMax(IlcInt time) const
public IlcIntgetLevelMaxMax(IlcInt timeMin, IlcInt timeMax) const
public IlcIntgetLevelMaxMin(IlcInt timeMin, IlcInt timeMax) const
public IlcIntgetLevelMin(IlcInt time) const
public IlcIntgetLevelMinMax(IlcInt timeMin, IlcInt timeMax) const
public IlcIntgetLevelMinMin(IlcInt timeMin, IlcInt timeMax) const
public voidoperator=(const IlcReservoir & h)
public voidsetLevelMax(IlcInt timeMin, IlcInt timeMax, IlcInt levelMax)
public voidsetLevelMin(IlcInt timeMin, IlcInt timeMax, IlcInt levelMin)
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

IlcReservoir

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

IlcReservoir

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

IlcReservoir

public IlcReservoir(IlcSchedule schedule, IlcInt capacity=IlcMaxCapacityReservoir, IlcInt initialLevel=OL, IlcBool timetable=IlcTrue)

This constructor creates a new instance of IlcReservoir and adds it to the set of resources managed in the given schedule. The capacity argument expresses the capacity of the new reservoir. The capacity may be consumed by certain activities and produced by others. The argument initialLevel defines an initial amount in the reservoir at the time origin of the schedule. By default, the reservoir is assumed to be empty at the time origin; that is, the initial level is 0 (zero). The default value of the theoretical capacity is IlcIntMax/2. That is the maximal theoretical capacity that is allowed. Any capacity greater than IlcIntMax/2 will be treated as if it were equal to IlcIntMax/2.

If timetable is IlcTrue, then a timetable constraint is posted, defining the level of the reservoir to be between 0 (zero) and capacity over the interval [timeMin timeMax), where timeMin is the origin and timeMax is the horizon of the schedule. An instance of IloSolver::SolverErrorException is thrown if capacity is strictly negative.


Method Detail

getCapacity

public IlcInt getCapacity() const

This member function returns the theoretical capacity of the invoking reservoir, that is, the capacity that was passed to the resource constructor. If the theoretical capacity is unlimited, then this member function returns IlcIntMax/2 (a platform-dependent Solver constant indicating the greatest possible integer).


getImpl

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

getInitialLevel

public IlcInt getInitialLevel() const

This member function returns the initial level of the reservoir; that is, the initial level that was passed to the reservoir constructor.


getLevelMax

public IlcInt getLevelMax(IlcInt time) const

This member function returns the maximal level that is present at the given time. An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the given time.


getLevelMaxMax

public IlcInt getLevelMaxMax(IlcInt timeMin, IlcInt timeMax) const

This member function returns the maximal level throughout the interval [timeMin, timeMax) (that is, the maximal value over the interval [timeMin, timeMax) of the maximal reservoir level). An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the complete interval indicated by [timeMin, timeMax).


getLevelMaxMin

public IlcInt getLevelMaxMin(IlcInt timeMin, IlcInt timeMax) const

This member function returns the maximal valiue, over the interval [timeMin, timeMax), of the minimal reservoir level. An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the complete interval indicated by [timeMin, timeMax).


getLevelMin

public IlcInt getLevelMin(IlcInt time) const

This member function returns the minimal level that is present at the given time. An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the given time.


getLevelMinMax

public IlcInt getLevelMinMax(IlcInt timeMin, IlcInt timeMax) const

This member function returns the minimal value, over the interval [timeMin, timeMax), of the maximal reservoir level. An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the complete interval indicated by [timeMin, timeMax).


getLevelMinMin

public IlcInt getLevelMinMin(IlcInt timeMin, IlcInt timeMax) const

This member function returns the minimal level throughout the interval [timeMin, timeMax) (that is, the minimal value over the interval [timeMin, timeMax) of the minimal reservoir level). An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the complete interval indicated by [timeMin, timeMax).


operator=

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

setLevelMax

public void setLevelMax(IlcInt timeMin, IlcInt timeMax, IlcInt levelMax)

This member function states that the level of the reservoir can be at most levelMax throughout the interval [timeMin, timeMax). An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the complete interval indicated by [timeMin, timeMax). The reservoir must be closed in order to propagate constraints.


setLevelMin

public void setLevelMin(IlcInt timeMin, IlcInt timeMax, IlcInt levelMin)

This member function states that the level of the reservoir must be at least levelMin throughout the interval [timeMin timeMax). An instance of IloSolver::SolverErrorException is thrown if the timetables of the invoking reservoir do not cover the complete interval indicated by [timeMin, timeMax). The reservoir must be closed in order to propagate constraints.