Overview | Group | Tree | Graph | Index | Concepts |
An instance of the class IloAltResSet
represents a special
set of resources to which activities can be assigned.
This class inherits from the IBM® ILOG® Concert Technology class
IloExtractable
. That class is documented in the IBM ILOG
Concert Technology Reference Manual.
When an activity requires an instance of this class, the activity
requires exactly one of the resources represented in that set. For
convenience, we say that an instance of IloAltResSet
behaves
like a standard resource. To that end, the class includes member functions
that reproduce the properties and behavior of a standard resource.
The set of resources (the alternatives) must consist of capacity
resources (that is, instances of IloDiscreteEnergy
, IloDiscreteResource
, IloUnaryResource
, IloContinuousReservoir
or IloReservoir
).
Redundant Resources
It is possible to consider the set of resources as a resource whose theoretical capacity is the sum of the capacities of the resources of the set. This resource is called the redundant resource of the set. The redundant resource of an alternative set of unary or discrete resources is a discrete resource. The redundant resource of an alternative set of discrete energy resources is a discrete energy resource. The redundant resource of an alternative set of reservoirs is a reservoir.
When created (see member functions IloAltResSet::getRedundantResource
and IloAltResSet::setRedundantResource
), a redundant resource can be used as a
normal resource. In particular, the parameters of the redundant resource can
be modified.
See Also:
IloResource, IloAltResSet::Iterator
Constructor Summary | |
---|---|
public | IloAltResSet() |
public | IloAltResSet(IloAltResSetI * impl) |
public | IloAltResSet(const IloEnv env, const char * name=0) |
Method Summary | |
---|---|
public void | add(const IloResource resource) const |
public IloBool | contains(const IloResource resource) const |
public IloAltResSetI * | getImpl() const |
public IloCapResource | getRedundantResource() const |
public IloBool | hasRedundantResource() const |
public IloBool | isKeptOpen() const |
public IloBool | operator==(const IloAltResSet resource) const |
public void | remove(const IloResource resource) const |
public void | setRedundantResource(IloBool redundant=IloTrue) const |
Inner Class |
---|
IloAltResSet::Iterator |
Constructor Detail |
---|
This constructor creates a new instance of IloAltResSet
and
adds it to those managed in the environment. This set of alternative
resources is initially empty.
Method Detail |
---|
This member function adds a new resource
to the invoking
alternative resource set.
This member function returns IloTrue
if
resource
currently belongs to the invoking instance of
IloAltResSet
. Otherwise, it returns IloFalse
.
This member function returns the redundant resource of the invoking
alternative resource set. If this redundant resource does not currently
exist - no previous call to the member function
setRedundantResource
(IloTrue
) - this member
function will create it. In that case, the current alternative resource set
must not be empty and all the resources of the set must be of the same type
(discrete, discrete energy, or reservoir). Otherwise, an error will be
raised.
This member function returns IloTrue
if the invoking
alternative resource set is currently associated with a redundant resource.
Otherwise, it will return IloFalse
.
This member function returns IloTrue
if all resources
belonging to the invoking alternative resource set must be kept open during
the search. Otherwise, it returns IloFalse
.
This operator returns IloTrue
if the invoking instance and
the argument resource
are identical; that is, they are both
handles with the same implementation object. Otherwise, it returns
IloFalse
.
This member function removes resource
from the invoking
alternative resource set.
If the argument redundant
is equal to IloTrue
,
this member function will create a redundant resource for the invoking
alternative resource set. In that case, the current alternative resource set
must not be empty, and all the resources of the set must be of the same type
(discrete, discrete energy, or reservoir). Otherwise, an error will be
raised.
If the argument redundant
is equal to IloFalse
and if a redundant resource already exists - from a previous call to
setRedundantResource(IloTrue)
or
getRedundantResource()
- this resource will no longer be
considered as the redundant resource of the invoking alternative resource
set. Note that this resource will still exist as well as its parameters and
the activities that may use it.