FRAMES NO FRAMES

Class IloAltResSet

Definition file: ilsched/iloaltresset.h
Include file: <ilsched/iloscheduler.h>
Alternative Resource Set.

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:

Constructor Summary
public IloAltResSet()
public IloAltResSet(IloAltResSetI * impl)
public IloAltResSet(const IloEnv env, const char * name=0)
Method Summary
public voidadd(const IloResource resource) const
public IloBoolcontains(const IloResource resource) const
public IloAltResSetI *getImpl() const
public IloCapResourcegetRedundantResource() const
public IloBoolhasRedundantResource() const
public IloBoolisKeptOpen() const
public IloBooloperator==(const IloAltResSet resource) const
public voidremove(const IloResource resource) const
public voidsetRedundantResource(IloBool redundant=IloTrue) const
Inner Class
IloAltResSet::Iterator
Constructor Detail

IloAltResSet

public IloAltResSet()
This constructor creates an instance that 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.

IloAltResSet

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

IloAltResSet

public IloAltResSet(const IloEnv env, const char * name=0)

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

add

public void add(const IloResource resource) const

This member function adds a new resource to the invoking alternative resource set.


contains

public IloBool contains(const IloResource resource) const

This member function returns IloTrue if resource currently belongs to the invoking instance of IloAltResSet. Otherwise, it returns IloFalse.


getImpl

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

getRedundantResource

public IloCapResource getRedundantResource() const

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.


hasRedundantResource

public IloBool hasRedundantResource() const

This member function returns IloTrue if the invoking alternative resource set is currently associated with a redundant resource. Otherwise, it will return IloFalse.


isKeptOpen

public IloBool isKeptOpen() const

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.


operator==

public IloBool operator==(const IloAltResSet resource) const

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.


remove

public void remove(const IloResource resource) const

This member function removes resource from the invoking alternative resource set.


setRedundantResource

public void setRedundantResource(IloBool redundant=IloTrue) const

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.