FRAMES NO FRAMES

Class IlcContinuousReservoir

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

An instance of the class IlcContinuousReservoir represents a resource which activities can either fill or empty in a continuous process. For example, if an activity that starts at time st and ends at time et can fill the reservoir by a capacity C, the quantity put in the continuous reservoir by the activity at time t is the following.

If the duration of the activity is null, the filling (or emptying) process is not continuous since the quantity C is instantaneously put in (or removed from) the reservoir at time et (which is equal to st).

Scheduler Engine ensures no attempt is made to further empty an already-empty continuous reservoir. Furthermore, if you define a maximal level of the continuous reservoir, then this maximal level will never be exceeded.

When the problem model represents an ongoing process, the continuous reservoir may already have some non-zero level present. To avoid this situation, simply pass an initial level to the constructor of IlcContinuousReservoir.

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

Closing a Continuous Reservoir

As for the class IlcReservoir, the member function IlcResource::close is crucial for propagation affecting the class IlcContinuousReservoir. If close is not called, new activities filling or emptying the reservoir can still be added; thus preventing propagation. The continuous reservoir must be closed before propagation can take place.

Disjunctive Constraints

As with reservoirs, there are no disjunctive constraints with continuous reservoirs.

Printing or Displaying Continuous Reservoirs

The printed representation of an instance of the class IlcContinuousReservoir 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 continuous 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 "IlcContinuousReservoir" 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.

See Also:

Constructor Summary
public IlcContinuousReservoir()
public IlcContinuousReservoir(IlcContinuousReservoirI * impl)
public IlcContinuousReservoir(IlcSchedule schedule, IlcInt capacity=IlcMaxCapacityReservoir, IlcFloat initialLevel=0, IlcBool timetable=IlcTrue)
Method Summary
public IlcContinuousReservoirI *getImpl() const
public IlcFloatgetInitialLevel() const
public IlcFloatgetLevelMax(IlcInt time) const
public IlcFloatgetLevelMaxMax(IlcInt t1, IlcInt t2) const
public IlcFloatgetLevelMaxMin(IlcInt t1, IlcInt t2) const
public IlcFloatgetLevelMin(IlcInt time) const
public IlcFloatgetLevelMinMax(IlcInt t1, IlcInt t2) const
public IlcFloatgetLevelMinMin(IlcInt t1, IlcInt t2) const
public IlcFloatTimetablegetTimetable(IlcInt time) const
public IlcFloatTimetablegetTimetable() const
public IlcConstraintmakeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcFloat precision=ILC_CONTINUOUS_RESERVOIR_PRECISION)
public voidoperator=(const IlcContinuousReservoir & h)
public voidsetLevelMax(IlcInt timeMin, IlcInt timeMax, IlcFloat levelMax)
public voidsetLevelMin(IlcInt timeMin, IlcInt timeMax, IlcFloat 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

IlcContinuousReservoir

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

IlcContinuousReservoir

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

IlcContinuousReservoir

public IlcContinuousReservoir(IlcSchedule schedule, IlcInt capacity=IlcMaxCapacityReservoir, IlcFloat initialLevel=0, IlcBool timetable=IlcTrue)

This constructor creates a new instance of IlcContinuousReservoir and adds it to the set of resources managed in the given schedule. The capacity expresses the capacity of the new continuous reservoir. The capacity may be consumed by certain activities and produced by others. The argument initialLevel defines an initial amount in the continuous 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 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) with theoretical 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

getImpl

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

getInitialLevel

public IlcFloat getInitialLevel() const

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


getLevelMax

public IlcFloat 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 continuous reservoir do not cover the given time.


getLevelMaxMax

public IlcFloat getLevelMaxMax(IlcInt t1, IlcInt t2) const

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


getLevelMaxMin

public IlcFloat getLevelMaxMin(IlcInt t1, IlcInt t2) const

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


getLevelMin

public IlcFloat 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 timetable of the invoking continuous reservoir does not cover the given time.


getLevelMinMax

public IlcFloat getLevelMinMax(IlcInt t1, IlcInt t2) const

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


getLevelMinMin

public IlcFloat getLevelMinMin(IlcInt t1, IlcInt t2) const

This member function returns the minimal consumable level throughout the integer time points of the interval [timeMin, timeMax) (that is, the minimal value over the time points timeMin, ..., timeMax-1 of the minimal resource level). An instance of IloSolver::SolverErrorException is thrown if the timetable of the invoking continuous reservoir does not cover the complete interval indicated by [timeMin, timeMax).


getTimetable

public IlcFloatTimetable 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.


getTimetable

public IlcFloatTimetable 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.


makeTimetableConstraint

public IlcConstraint makeTimetableConstraint(IlcInt timeMin, IlcInt timeMax, IlcFloat precision=ILC_CONTINUOUS_RESERVOIR_PRECISION)

This member function creates and returns a timetable constraint for the invoking continuous reservoir. This timetable constraint implies that the capacity of the continuous reservoir is limited to the theoretical capacity of the reservoir from timeMin to timeMax. The time step of the timetable is 1. An instance of IloSolver::SolverErrorException is thrown if timeMin is not strictly less than timeMax or if the new timetable overlaps another timetable that has already been created for the invoking continuous reservoir.


operator=

public void operator=(const IlcContinuousReservoir & 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, IlcFloat levelMax)

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


setLevelMin

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

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