FRAMES NO FRAMES

Class IlcRCTextureTargetI

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

IlcRCTextureTargetI is the implementation class for the target start time individual texture curve. This individual curve represents the individual demand of the associated resource constraint for its resource based on the assumption that it will start at an externally defined target start time. The points used in the texture curve can be seen in the example code below.

For more information, see Texture Measurements.

See Also:

Constructor and Destructor Summary
public IlcRCTextureTargetI(IlcManager m, IlcResourceConstraint rc, IlcResourceTexture resTexture)
Method Summary
protected virtual IlcBoolupdateDataPoints()
Inherited Methods from IlcRCTextureESTI
calculateIndividualCurve
Inherited Methods from IlcRCTextureI
calcAltWeight, calculateIndividualCurve, getAltWeight, getCapacity, getDuration, getEnd, getResourceConstraint, getStart, getTargetStart, insertEvent, setAltWeight, setCapacity, setDuration, setEnd, setStart, setTargetStart, updateDataPoints
Constructor and Destructor Detail

IlcRCTextureTargetI

public IlcRCTextureTargetI(IlcManager m, IlcResourceConstraint rc, IlcResourceTexture resTexture)

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


Method Detail

updateDataPoints

protected virtual IlcBool updateDataPoints()

This virtual, protected function updates all the data points on which the curve is calculated.

Example

Here is an example of how the updateDataPoints() method might be written.


 IlcBool IlcRCTextureTargetI::updateDataPoints() {
   IlcResourceConstraint rc = getResourceConstraint();
   IlcFloat newAltWeight = calcAltWeight();
   IlcInt dur, cap;
   IlcFloat startMin = getStartTime();

   IlcAltResConstraint altRct = rc.getAlternative();
   if (0 != altRct.getImpl()) {
     IlcResource res = rc.getResource();
     dur = altRct.getDurationMax(res);
     cap = altRct.getCapacityMax(res);
   }

   else {
     IlcActivity act = rc.getActivity();
     dur = act.getDurationMax();
     cap = (rc.isVariableResourceConstraint() ?
 	   rc.getCapacityVariable().getMax() :
 	   rc.getCapacity());
   }

   IlcBool changed = IlcFalse;
   if ((getStartMin() != startMin) ||
       (getDuration() != dur) ||
       (getCapacity() != cap) ||
       (getAltWeight() != newAltWeight)) {
     changed = IlcTrue;

     setStart(startMin);
     setDuration(dur);
     setEnd(startMin + dur);
     setCapacity(cap);
     setAltWeight(newAltWeight);
   }

   return changed;
 }