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

A constraint on the addition of the attributes of a block. More...

#include <constraint.h>

Inheritance diagram for delphos::AttributeSumConstraint:
Inheritance graph
Collaboration diagram for delphos::AttributeSumConstraint:
Collaboration graph

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

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

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
nameA name for the constraint.
periodThe time-period at which the constraint applies.
attributeAttribute that will be bounded (its addition).
destinationsThe list of destinations affected by the constraint.
min_valueThe lower limit to impose on the sum of the attribute.
max_valueThe upper limit to impose on the sum of the attribute.
bsThe given block selection to be constrained.

Member Function Documentation

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

Checks if the schedule satisfies the constraint.

Parameters
schThe schedule to be checked.

Returns true if the schedule satisfies the constraint, and false of not.

Reimplemented from delphos::Constraint.

Reimplemented in delphos::AttributeAvgConstraint.

bool delphos::AttributeSumConstraint::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::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.

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

Field Documentation

const double delphos::AttributeSumConstraint::NegativeInfinite = -INFINI
static

Useful constant for 'negative infinite'.

If used as a lower limit in the sum constraint, then no actual lower bound is imposed.

const double delphos::AttributeSumConstraint::PositiveInfinite = +INFINI
static

Useful constant for 'positive infinite'.

If used as a upper limit in the sum constraint, then no actual upper bound is imposed.


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