![]() |
MineLink
|
A constraint on the addition of the attributes of a block. More...
#include <constraint.h>
Public Member Functions | |
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... | |
virtual bool | Check (const delphos::Schedule &sch) const |
Checks if the schedule satisfies the constraint. More... | |
virtual bool | Check (const delphos::FractionalSchedule &sch) const |
Checks if the given fractional schedule satisfies the 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... | |
Static Public Attributes | |
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 addition of the attributes of a block.
This constraint allows to limit the overall sum of an attribute for blocks sent to a set of destinations, at a given time-period.
delphos::AttributeSumConstraint::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.
name | A name for the constraint. |
period | The time-period at which the constraint applies. |
attribute | Attribute that will be bounded (its addition). |
destinations | The list of destinations affected by the constraint. |
min_value | The lower limit to impose on the sum of the attribute. |
max_value | The upper limit to impose on the sum of the attribute. |
bs | The given block selection to be constrained. |
|
virtual |
Checks if the schedule satisfies the constraint.
sch | The schedule to be checked. |
Returns true if the schedule satisfies the constraint, and false of not.
Reimplemented from delphos::Constraint.
Reimplemented in delphos::AttributeAvgConstraint.
|
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::Constraint.
Reimplemented in delphos::AttributeAvgConstraint.
string delphos::AttributeSumConstraint::GetAffectedDestination | ( | const unsigned int & | i | ) | const |
Returns the name of the i-th destinations affected by the constraint.
i | The given i-th position. |
Return the name of the i-th destinations affected by the constraint.
const unsigned int delphos::AttributeSumConstraint::GetNumAffectedDestinations | ( | ) | const |
Returns the number of destinations affected by the constraint.
Return the number of destinations affected by the constraint.
const string delphos::AttributeSumConstraint::GetSumAttribute | ( | ) | const |
Returns the attribute to be added up and limited.
Return the attribute to be added up and limited.
const bool delphos::AttributeSumConstraint::IsLowerBounded | ( | ) | const |
Checks if the lower limit applies or not.
Checks if the lower limit is set to "-Infinity" or not. Return False if so.
const bool delphos::AttributeSumConstraint::IsUpperBounded | ( | ) | const |
Checks if the upper bound limit applies or not.
Checks is the upper bound is set to "+Infinite" or not. Return False if so.
const unsigned int delphos::AttributeSumConstraint::NumAffectedDestinations | ( | ) | const |
Returns the number of destinations affected by the constraint.
Return the number of destinations affected by the constraint. Deprecated.
const string delphos::AttributeSumConstraint::SumAttribute | ( | ) | const |
Returns the attribute to be added up and limited.
Return the attribute to be added up and limited. Deprecated.
|
static |
Useful constant for 'negative infinite'.
If used as a lower limit in the sum constraint, then no actual lower bound is imposed.
|
static |
Useful constant for 'positive infinite'.
If used as a upper limit in the sum constraint, then no actual upper bound is imposed.