Class LPScheduler::FluentTracking
Defined in File lpscheduler.h
Nested Relationships
This class is a nested type of Class LPScheduler.
Class Documentation
-
class FluentTracking
A class to track the changes on a task numeric variable as the LP is built for the plan so far.
Public Types
-
enum fluent_status
An enum defining three states a numeric variable can be in when building the LP:
FS_NORMAL
denotes that the variable should be treated normally, with effects and preconditions on the variable being included in the LP.FS_IGNORE
denotes that the variable is a metric tracking variable, to be ignored (i.e. effects on it should be omitted from the LP)FS_ORDER_INDEPENDENT
denotes that the variable is an order-independent metric-tracking variable, and effects on it are to update the variablesFluentTracking::orderIndependentValueTerms
andFluentTracking::orderIndependentValueConstant
, for eventual inclusion into the objective function.
Values:
-
enumerator FS_NORMAL
-
enumerator FS_IGNORE
-
enumerator FS_ORDER_INDEPENDENT
Public Functions
-
inline FluentTracking(const double &initial)
Initial constructor: the variable takes the given value (that from the initial state), its status is set to
FS_NORMAL
, and no continuous numeric change is active.- Parameters:
initial – The value of the fluent in the initial state.
-
inline FluentTracking()
Default constructor (unfortunately needed to be able to create a vector of
FluentTracking
objects).
Public Members
-
fluent_status statusOfThisFluent
The status of this fluent. For metric-tracking variables, this is set to either
FS_IGNORE
orFS_ORDER_INDEPENDENT
in theLPScheduler
constructor, depending on whether the plan is to be scheduled to the metric. For all other variables, this is set toFS_NORMAL
.
-
double postLastEffectValue
The value of the variable following the last effect. This is only defined if
FluentTracking::lastEffectValueVariable = -1
.
-
int lastEffectValueVariable
The LP variable (column) containing the value of the variable following the last effect to act upon it. If this takes the value
-1
, then the value is a constant, not an LP variable, stored inFluentTracking::postLastEffectValue
.
-
int lastEffectTimestampVariable
The timestamp variable of the last action with an effect upon this variable. If this takes the value
-1
, then no such action exists (i.e. there have been no effects on the variable so far).
-
double activeGradient
The gradient of the active continuous numeric change acting upon the variable.
-
int activeGradientCount
How many actions are having a continuous numeric effect upon the variable. This is used to prevent rounding errors: if this value takes the value 0, then
FluentTracking::activeGradient
is assigned the value0
.
-
map<int, double> orderIndependentValueTerms
For metric-traking variables with order-independent effects, this map contains column—weight pairs that contribute to its value.
-
double orderIndependentValueConstant
For metric-tracking variables with order-independent effects, the sum of this constant value and the weighted sum of the LP columns given in
FluentTracking::orderIndependentValueTerms
give the value of the variable at the end of the plan.
-
enum fluent_status