Overview | Group | Tree | Graph | Index | Concepts |
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:
IlcRCTextureIterator, IlcResourceTexture, IlcRCTextureFactoryI, IlcRCTextureESTI, IlcRCTextureProbabilisticI, IlcRCTextureTargetI
Constructor and Destructor Summary | |
---|---|
protected | IlcRCTextureI(IlcManager m, IlcResourceConstraint, IlcResourceTexture) |
Method Summary | |
---|---|
protected IlcFloat | calcAltWeight() const |
protected virtual void | calculateIndividualCurve() |
public IlcFloat | getAltWeight() const |
public IlcFloat | getCapacity() const |
public IlcFloat | getDuration() const |
public IlcFloat | getEnd() const |
public IlcResourceConstraint | getResourceConstraint() const |
public IlcFloat | getStart() const |
public IlcFloat | getTargetStart() const |
protected void | insertEvent(IlcFloat t, IlcFloat demand, IlcFloat demandDisc=0, IlcFloat var=0, IlcFloat varDisc=0) |
protected void | setAltWeight(IlcFloat altW) |
protected void | setCapacity(IlcFloat cap) |
protected void | setDuration(IlcFloat dur) |
protected void | setEnd(IlcFloat lft) |
protected void | setStart(IlcFloat est) |
public void | setTargetStart(IlcFloat) |
protected virtual IlcBool | updateDataPoints() |
Constructor and Destructor Detail |
---|
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 |
---|
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
.
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.
IlcRCTextureI::insertEvent
.
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.
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.
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.
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.
This method returns a pointer to the implementation class of the resource constraint associated with the invoking individual texture curve.
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.
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.
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:
IlcRCTextureI::calculateIndividualCurve
function.IlcRCTextureI::calculateIndividualCurve
.IlcRCTextureI::calculateIndividualCurve
) must insert elements in
ascending temporal order to ensure the correct connectivity.The arguments to this method are as follows:
t
- This is the time point of the event.
demand
- This is the value of the demand for the associated resource
constraint for the resource at time point
t
.
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.
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.
varDisc
- This is the discontinuity in the variance curve.This protected method allows the alternative weight data point of the invoking object to be set.
This protected method allows the capacity data point of the invoking object to be set.
This protected method allows the duration data point of the invoking object to be set.
This protected method allows the maximum end data point of the invoking object to be set.
This protected method allows the minimum start time data point of the invoking object to be set.
This protected method allows the preferred start time data point of the invoking object to be set.
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.
IlcRCTextureI::setAltWeight
.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
.