Overview | Group | Tree | Graph | Index | Concepts |
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:
IlcCapResource, IlcReservoirIterator, IlcResource, IlcResourceConstraint, IlcSchedule
Constructor Summary | |
---|---|
public | IlcReservoir() |
public | IlcReservoir(IlcReservoirI * impl) |
public | IlcReservoir(IlcSchedule schedule, IlcInt capacity=IlcMaxCapacityReservoir, IlcInt initialLevel=OL, IlcBool timetable=IlcTrue) |
Method Summary | |
---|---|
public IlcInt | getCapacity() const |
public IlcReservoirI * | getImpl() const |
public IlcInt | getInitialLevel() const |
public IlcInt | getLevelMax(IlcInt time) const |
public IlcInt | getLevelMaxMax(IlcInt timeMin, IlcInt timeMax) const |
public IlcInt | getLevelMaxMin(IlcInt timeMin, IlcInt timeMax) const |
public IlcInt | getLevelMin(IlcInt time) const |
public IlcInt | getLevelMinMax(IlcInt timeMin, IlcInt timeMax) const |
public IlcInt | getLevelMinMin(IlcInt timeMin, IlcInt timeMax) const |
public void | operator=(const IlcReservoir & h) |
public void | setLevelMax(IlcInt timeMin, IlcInt timeMax, IlcInt levelMax) |
public void | setLevelMin(IlcInt timeMin, IlcInt timeMax, IlcInt levelMin) |
Constructor Detail |
---|
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 |
---|
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).
This member function returns the initial level of the reservoir; that is, the initial level that was passed to the reservoir constructor.
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
.
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)
.
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)
.
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
.
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)
.
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)
.
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.
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.