![]() |
MineLink
|
A constraint on the average values of attributes of blocks. More...
#include <constraint.h>
Public Member Functions | |
AttributeAvgConstraint (const string &name, const unsigned int &period, const string &sum_attr, const string &weight_attr, const vector< string > &destinations, const double min_value=NegativeInfinite, const double max_value=PositiveInfinite, delphos::BlockSelection *bs=NULL, const double term_min=0.0, const double term_max=0.0) | |
virtual | ~AttributeAvgConstraint () |
Destroys the attribute average constraint. | |
virtual bool | Check (const delphos::Schedule &sch) const |
Checks if the constraint is satisfied by the schedule. More... | |
virtual bool | Check (const delphos::FractionalSchedule &sch) const |
Checks if the given fractional schedule satisfies the constraint. More... | |
const string | WeightAttribute () const |
The attribute to be used as weight for the average of the attribute. The attribute to be used as weight for the average of the attribute. Deprecated. | |
const string | GetWeightAttribute () const |
The attribute to be used as weight for the average of the attribute. The attribute to be used as weight for the average of the attribute. | |
const double | GetFixedTermMin () const |
Returns the fixed term on minimum bound. | |
const double | GetFixedTermMax () const |
Returns the fixed term on the maximum bound. | |
![]() | |
AttributeSumConstraint (const string &name, const unsigned int &period, const string &attribute, const vector< string > &destinations, const double min_value=NegativeInfinite, const double max_value=PositiveInfinite, delphos::BlockSelection *bs=NULL) | |
Creates a new sum constraint. More... | |
const string | SumAttribute () const |
Returns the attribute to be added up and limited. More... | |
const string | GetSumAttribute () const |
Returns the attribute to be added up and limited. More... | |
const double | MinValue () const |
Returns the lower limit set by the constraint. Return the lower limit set by the constraint. | |
const double | GetMinValue () const |
Returns the lower limit set by the constraint. Return the lower limit set by the constraint. | |
const double | MaxValue () const |
Returns the upper limit set by the constraint. Return the upper limit set by the constraint. | |
const double | GetMaxValue () const |
Returns the upper limit set by the constraint. Return the upper limit set by the constraint. | |
const bool | IsLowerBounded () const |
Checks if the lower limit applies or not. More... | |
const bool | IsUpperBounded () const |
Checks if the upper bound limit applies or not. More... | |
const unsigned int | NumAffectedDestinations () const |
Returns the number of destinations affected by the constraint. More... | |
const unsigned int | GetNumAffectedDestinations () const |
Returns the number of destinations affected by the constraint. More... | |
string | GetAffectedDestination (const unsigned int &i) const |
Returns the name of the i-th destinations affected by the constraint. More... | |
const vector< string > & | GetAffectedDestinations () const |
Returns the affected destinations. | |
![]() | |
BlockTimingConstraint (const string &name, const unsigned int &period, delphos::BlockModel &bm) | |
Creates a constraint limiting the period . More... | |
BlockTimingConstraint (const string &name, const unsigned int &period, delphos::BlockSelection *bs) | |
Creates a constraint limiting the period . More... | |
![]() | |
BlockConstraint (const string &name, delphos::BlockModel &bm) | |
Creates a new block selection constraint. More... | |
BlockConstraint (const string &name, delphos::BlockSelection *bs) | |
Creates a new block selection constraint. More... | |
delphos::BlockSelection * | GetBlockSelection () const |
Returns the selection of blocks being constrained. | |
virtual | ~BlockConstraint () |
Destroys a block constraint. | |
![]() | |
Constraint (const string &name) | |
Creates a constraint with given name. More... | |
virtual | ~Constraint () |
Destructor. More... | |
virtual string | ToXML (const unsigned int identation_level=0) const |
A XML string describing the constraint. More... | |
const char * | TypeName () const |
a char string used a identifier in the XML representation of the constraint. | |
![]() | |
TimedConstraint (const string &name, const unsigned int &period) | |
Creates a new timed constraint. More... | |
virtual | ~TimedConstraint () |
destroys a timed constraint. | |
const unsigned int | GetPeriod () const |
Returns the time-period that the constraint applies at. More... | |
Additional Inherited Members | |
![]() | |
static const double | NegativeInfinite = -INFINI |
Useful constant for 'negative infinite'. More... | |
static const double | PositiveInfinite = +INFINI |
Useful constant for 'positive infinite'. More... | |
A constraint on the average values of attributes of blocks.
This constraints allows to limit the average value of blocks sent to a set of destinations at a given time-period.
In this constraint, a certain "sum_attribute" is averaged (weighted by a "weight_attribute") over the blocks sent to a set of destinations at a given time-period. The constraint is satisfied only if this average is within given limits.
delphos::AttributeAvgConstraint::AttributeAvgConstraint | ( | const string & | name, |
const unsigned int & | period, | ||
const string & | sum_attr, | ||
const string & | weight_attr, | ||
const vector< string > & | destinations, | ||
const double | min_value = NegativeInfinite , |
||
const double | max_value = PositiveInfinite , |
||
delphos::BlockSelection * | bs = NULL , |
||
const double | term_min = 0.0 , |
||
const double | term_max = 0.0 |
||
) |
Creates a new average limit constraint.
name | A name for the constraint. |
period | The period at which the constraint applies. |
sum_attr | The attribute to be averaged. |
weight_attr | The attribute to be used as weight in the average. |
destinations | The destinations affected by the constraint. |
min_value | The minimum average value for the sum_attribute. |
max_value | The maximum average value for the sum attribute. |
bs | The given block selection to be constrained. |
|
virtual |
Checks if the constraint is satisfied by the schedule.
sch | The schedule to be checked. |
Checks if the constraint is satisfied by the schedule.
Reimplemented from delphos::AttributeSumConstraint.
|
virtual |
Checks if the given fractional schedule satisfies the constraint.
fsch | The fractional schedule to be checked. |
This method checks if the given schedule satisfies the constraint (returning true) or not (return false).
Reimplemented from delphos::AttributeSumConstraint.