FRAMES NO FRAMES

Class IloCoverConstraint

Definition file: ilsched/iloactivity.h
Include file: <ilsched/iloscheduler.h>

Instances of the class IloCoverConstraint are cover constraints. A cover constraint states that an activity (the covering activity) must exactly cover a set of activities (the covered activities). More precisely, it means that the start time of the covering activity is equal to the earliest of the start times of the covered activities, and that the end time of the covering activity is equal to the latest of the end times of the covered activities.

This class inherits from the IBM® ILOG® Concert Technology class IloConstraint. That class is documented in the IBM ILOG Concert Technology Reference Manual.

Instances of this class are created by the member function IloActivity::covers.

See Also:

Constructor Summary
public IloCoverConstraint()
public IloCoverConstraint(IloCoverConstraintI * impl)
Method Summary
public voidadd(const IloActivity act) const
public IloBoolcontains(const IloActivity act) const
public IloActivitygetActivity() const
public IloCoverConstraintI *getImpl() const
public voidremove(const IloActivity act) const
Constructor Detail

IloCoverConstraint

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

IloCoverConstraint

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

Method Detail

add

public void add(const IloActivity act) const

This member function adds the activity act to the set of activities to be covered.

Example

The code:


 IloCoverConstraint coverCT = act.covers();
 coverCT.add(act1);
 coverCT.add(act2);
 model.add(coverCT); 

adds to the model the constraint that activity act must cover both activities act1 and act2. Another way to add the same constraint is:

model.add(act.covers(2, act1, act2));


contains

public IloBool contains(const IloActivity act) const

This member function returns IloTrue if and only if the activity act is to be covered by the constraint.


getActivity

public IloActivity getActivity() const

This member function returns the covering activity of the cover constraint. That is, it returns the activity on which a member function IloActivity::covers was called to build the invoking cover constraint.


getImpl

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

remove

public void remove(const IloActivity act) const

This member function removes the activity act from the set of activities to be covered.