MineLink
 All Data Structures Functions Variables Pages
delphos::AttributeAvgConstraint Class Reference

A constraint on the average values of attributes of blocks. More...

#include <constraint.h>

Inheritance diagram for delphos::AttributeAvgConstraint:
Inheritance graph
Collaboration diagram for delphos::AttributeAvgConstraint:
Collaboration graph

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.
 
- Public Member Functions inherited from 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. 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.
 
- Public Member Functions inherited from delphos::BlockTimingConstraint
 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...
 
- Public Member Functions inherited from delphos::BlockConstraint
 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::BlockSelectionGetBlockSelection () const
 Returns the selection of blocks being constrained.
 
virtual ~BlockConstraint ()
 Destroys a block constraint.
 
- Public Member Functions inherited from delphos::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.
 
- Public Member Functions inherited from delphos::TimedConstraint
 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 Public Attributes inherited from delphos::AttributeSumConstraint
static const double NegativeInfinite = -INFINI
 Useful constant for 'negative infinite'. More...
 
static const double PositiveInfinite = +INFINI
 Useful constant for 'positive infinite'. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
nameA name for the constraint.
periodThe period at which the constraint applies.
sum_attrThe attribute to be averaged.
weight_attrThe attribute to be used as weight in the average.
destinationsThe destinations affected by the constraint.
min_valueThe minimum average value for the sum_attribute.
max_valueThe maximum average value for the sum attribute.
bsThe given block selection to be constrained.

Member Function Documentation

bool delphos::AttributeAvgConstraint::Check ( const delphos::Schedule sch) const
virtual

Checks if the constraint is satisfied by the schedule.

Parameters
schThe schedule to be checked.

Checks if the constraint is satisfied by the schedule.

Reimplemented from delphos::AttributeSumConstraint.

bool delphos::AttributeAvgConstraint::Check ( const delphos::FractionalSchedule sch) const
virtual

Checks if the given fractional schedule satisfies the constraint.

Parameters
fschThe 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.


The documentation for this class was generated from the following files: