FRAMES NO FRAMES

Class IlcRCTextureI

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

IlcRCTextureI is the implementation base class for the representation of the individual texture curve of a resource constraint on a resource. IlcRCTextureI is documented so that the user can create subclasses specifying the different types of individual curves. For example, by default the IlcRCTextureESTI subclass uses the maximum duration for the individual curve. If the user would rather use the minimum duration, a subclass of IlcRCTextureESTI could be written. See IlcRCTextureESTI for an example of subclassing IlcRCTextureI.

The individual curve is a piecewise linear curve represented by a set of points each of which have a time point and a demand. Optionally a point may represent a variance curve as well as the demand curve. The curves may be discontinuous, in which case the point representing the discontinuity must explicitly contain its magnitude and direction (that is, positive or negative). For example, the following figure represents two individual curves. The values of each of the data points (A through H) are listed in the table that follows.

Example of Demand Curve and Variance Curve

Data Points for the Demand Curve

Note that the data points are floating point values and can be negative.

Point Time Demand Demand Discontinuity Variance Variance Discontinuity
A 10 1 1 0 0
B 50 0 -1 0 0
C 10 0.25 0.25 0 0
D 16.66 0.5 0 0.4 0
E 23.33 1 0 0.125 0
F 36.66 1 0 0.125 0
G 43.33 0.5 0 0.4 0
H 50 0 0 0 0

Users have complete control over the definition of the individual curve. A number of data methods (such as IlcRCTextureI::getCapacity, IlcRCTextureI::setCapacity, IlcRCTextureI::getStart, IlcRCTextureI::setStart, etc.) are provided for the maintenance of data upon which the individual curves may be built.

The points of the individual curve must be inserted in ascending temporal order by the IlcRCTextureI::insertEvent method call from the IlcRCTextureI::calculateIndividualCurve method. See the example code for IlcRCTextureESTI::calculateIndividualCurve

.

For more information, see Texture Measurements.

See Also:

Constructor and Destructor Summary
protected IlcRCTextureI(IlcManager m, IlcResourceConstraint, IlcResourceTexture)
Method Summary
protected IlcFloatcalcAltWeight() const
protected virtual voidcalculateIndividualCurve()
public IlcFloatgetAltWeight() const
public IlcFloatgetCapacity() const
public IlcFloatgetDuration() const
public IlcFloatgetEnd() const
public IlcResourceConstraintgetResourceConstraint() const
public IlcFloatgetStart() const
public IlcFloatgetTargetStart() const
protected voidinsertEvent(IlcFloat t, IlcFloat demand, IlcFloat demandDisc=0, IlcFloat var=0, IlcFloat varDisc=0)
protected voidsetAltWeight(IlcFloat altW)
protected voidsetCapacity(IlcFloat cap)
protected voidsetDuration(IlcFloat dur)
protected voidsetEnd(IlcFloat lft)
protected voidsetStart(IlcFloat est)
public voidsetTargetStart(IlcFloat)
protected virtual IlcBoolupdateDataPoints()
Constructor and Destructor Detail

IlcRCTextureI

protected IlcRCTextureI(IlcManager m, IlcResourceConstraint, IlcResourceTexture)

This protected constructor creates an instance of IlcRCTextureI for resource constraint rct and the resource texture, texture. The created class represents the individual contribution of rct to the aggregate curve of texture. As this constructor is protected, it should only be called from subclasses of IlcRCTextureI.


Method Detail

calcAltWeight

protected IlcFloat calcAltWeight() const

This protected function calculates the alternative weight of the invoking IlcRCTextureI object. The alternative weight is an estimate of the probability that the resource constraint associated with the invoking object will be selected. The alternative weight is defined to be 1/nbAlt, where nbAlt is the number of possible alternatives for the alternative resource constraint associated with the invoking object. If the resource constraint associated with the invoking object is not an alternative resource constraint and does not participate in any meta-constraints, the alternative weight is 1. If the resource constraint associated with the invoking object is involved in meta-constraints, there is no general method for estimating the alternative weight. Therefore, in such a case, the alternative weight is defined to be 0.5.

Note that this function calculates and returns a value. There are no side-effects. In particular, if you want to store the alternative weight in the invoking object, you must call IlcRCTextureI::setAltWeight.


calculateIndividualCurve

protected virtual void calculateIndividualCurve()

This pure virtual, protected function creates the actual individual curve for the invoking object. Typically, the curve will be formulated based on the data points updated in the IlcRCTextureI::updateDataPoints method. However, no restriction is placed on the basis on which the individual curve is formed.

Note
WARNING! When this member function is called, it is necessary to completely recreate the curve by inserting all the curve elements in ascending temporal order using IlcRCTextureI::insertEvent.

getAltWeight

public IlcFloat getAltWeight() const

This function returns the alternative weight of the invoking IlcRCTextureI object. The alternative weight is the value assigned by the IlcRCTextureI::setAltWeight function. See the member function IlcRCTextureI::calcAltWeight for a detailed description of alternative weight. If the alternative weight has never been set, 1 is returned.


getCapacity

public IlcFloat getCapacity() const

This function returns the capacity value used to calculate the individual curve of the invoking object. This value is assigned using IlcRCTextureI::setCapacity. Note that even though the associated resource constraint may have a variable capacity, a single value, which is the maximum capacity of the resource constraint on the resource associated with the IlcResourceTexture instance, is used by default to calculate the individual curve. You can, of course, create your own subclass of IlcRCTextureI where a different value or even multiple values of capacity are used to form the individual curve.


getDuration

public IlcFloat getDuration() const

This method returns the duration value used to calculate the individual curve of the invoking object. This value is assigned using setDuration. Note that even though the associated resource constraint may have a variable duration, a single value, which is the maximum duration of the resource constraint on the resource associated with the IlcResourceTexture instance, is used by default to calculate the individual curve. You can, of course, create your own subclass of IlcRCTextureI where a different value or even multiple values of capacity are used to form the individual curve.


getEnd

public IlcFloat getEnd() const

This method returns the time value of the final point in the individual curve. This value is set using IlcRCTextureI::setEnd. Note that the value used here may not have any resemblance to the maximum end time of the activity associated with the resource constraint of the invoking object: it is simply the maximum time value of the end point of the individual curve. For example, in IlcRCTextureESTI, it can be seen that IlcRCTextureI::setEnd is used to assign the maximum end time to be IlcRCTextureI::getStart plus IlcRCTextureI::getDuration.


getResourceConstraint

public IlcResourceConstraint getResourceConstraint() const

This method returns a pointer to the implementation class of the resource constraint associated with the invoking individual texture curve.


getStart

public IlcFloat getStart() const

This method returns the time value of the initial point in the individual curve. This value is set using IlcRCTextureI::setStart. Note that the value used here may not have any resemblance to the minimum start time of the activity associated with the resource constraint of the invoking object: it is simply the minimum time value of the start point of the individual curve.


getTargetStart

public IlcFloat getTargetStart() const

This public method returns the time value that has been set from an external source using IlcRCTextureI::setTargetStart. The start time differs from the minimum start time in an important way: the minimum start time is the minimum possible time value for any elements of the individual curve. The start time is an expression of preference. Based on some external source, this time is the preferred start time. The calculation of the individual curve may take this information into account. For example, the IlcRCTextureTargetI class creates the individual curve assuming that the start time is the only possible start time. In contrast, IlcRCTextureProbabilisticI ignores the start time.


insertEvent

protected void insertEvent(IlcFloat t, IlcFloat demand, IlcFloat demandDisc=0, IlcFloat var=0, IlcFloat varDisc=0)

This member function inserts an event into the internal representation of the individual curve. There are three major restrictions with the use of this function:

  1. This method may only be called from the IlcRCTextureI::calculateIndividualCurve function.
  2. All the points of the curve must be reinserted in each call to IlcRCTextureI::calculateIndividualCurve.
  3. A series of consecutive calls to this function (within the same call to IlcRCTextureI::calculateIndividualCurve) must insert elements in ascending temporal order to ensure the correct connectivity.

The arguments to this method are as follows:

  1. t - This is the time point of the event.
  2. demand - This is the value of the demand for the associated resource constraint for the resource at time point t.
  3. demandDisc - This is the discontinuity in the demand curve at time t. Discontinuity means that the demand curve jumps non-continuously up or down by amount |demandDisc| at time t. A negative value indicates a negative jump. See points B and C in the figure at the start of this class.
  4. var - This is the variance of the demand that the associated resource constraint has for the resource at time point t. This value is only non-zero when the demand is the expected value of some probabilistic estimation of resource demand.
  5. varDisc - This is the discontinuity in the variance curve.

setAltWeight

protected void setAltWeight(IlcFloat altW)

This protected method allows the alternative weight data point of the invoking object to be set.


setCapacity

protected void setCapacity(IlcFloat cap)

This protected method allows the capacity data point of the invoking object to be set.


setDuration

protected void setDuration(IlcFloat dur)

This protected method allows the duration data point of the invoking object to be set.


setEnd

protected void setEnd(IlcFloat lft)

This protected method allows the maximum end data point of the invoking object to be set.


setStart

protected void setStart(IlcFloat est)

This protected method allows the minimum start time data point of the invoking object to be set.


setTargetStart

public void setTargetStart(IlcFloat)

This protected method allows the preferred start time data point of the invoking object to be set.


updateDataPoints

protected virtual IlcBool updateDataPoints()

This virtual method is called automatically during the process of updating the invoking individual texture curve. It must update all the data points upon which the individual curve is calculated. In particular, the version of this function for IlcRCTextureI updates the following items.

If one or more of the data points has changed, IlcTrue must be returned. Otherwise, IlcFalse is returned. The correct return value (depending on whether the data points have been modified) is critical for the correct updating of the individual texture curve. The user can override this function to update new data points that have been introduced in subclasses of IlcRCTextureI.