Evoplex  0.2.1
Public Member Functions | List of all members
evoplex::IntervalOfValues Class Reference

The IntervalOfValues class. More...

#include <attributerange.h>

Inheritance diagram for evoplex::IntervalOfValues:
evoplex::AttributeRange evoplex::AttributeRangeInterface

Public Member Functions

 IntervalOfValues (int id, const QString &attrName, Type type, const Value &min, const Value &max)
 Constructor. More...
 
 ~IntervalOfValues () override=default
 Destructor.
 
Value rand (PRG *prg) const override
 Gets a random value in the attribute range. More...
 
Value next (const Value &v) const override
 Gets the value after v. More...
 
Value prev (const Value &v) const override
 Gets the value before v. More...
 
- Public Member Functions inherited from evoplex::AttributeRange
 ~AttributeRange () override=default
 Destructor.
 
Value validate (const QString &valueStr) const
 Checks if the valueStr belongs to this attribute range. More...
 
bool isValid () const
 Checks if this AttributeRange is valid. More...
 
int id () const
 Gets the attribute id.
 
const QString & attrName () const
 Gets the attribute name.
 
const QString & attrRangeStr () const
 Gets the original attribute's range string. More...
 
Type type () const
 Gets the current attribute's range type.
 
const Valuemin () const
 Gets the minimum value in the range.
 
const Valuemax () const
 Gets the maximum value in the range.
 
- Public Member Functions inherited from evoplex::AttributeRangeInterface
virtual ~AttributeRangeInterface ()=default
 Destructor.
 

Additional Inherited Members

- Public Types inherited from evoplex::AttributeRange
enum  Type {
  Invalid, Double_Range, Int_Range, Bool,
  Double_Set, Int_Set, String_Set, String,
  NonEmptyString, DirPath, FilePath
}
 An enum for the attribute range types. More...
 
- Static Public Member Functions inherited from evoplex::AttributeRange
static AttributeRangePtr parse (int attrId, const QString &attrName, const QString &attrRangeStr)
 Creates an AttributeRange object from a valid attrRangeStr string. More...
 
- Protected Member Functions inherited from evoplex::AttributeRange
 AttributeRange (int id, const QString &attrName, Type type)
 AttributeRange constructor. More...
 
- Protected Attributes inherited from evoplex::AttributeRange
const int m_id
 
const QString m_attrName
 
const Type m_type
 
QString m_attrRangeStr
 
Value m_min
 
Value m_max
 

Detailed Description

The IntervalOfValues class.

It handles the 'attribute ranges' defined by an interval of values, e.g., AttributeRange::Double_Range, AttributeRange::Int_Range and AttributeRange::Bool.

See also
AttributeRange, SingleValue, SetOfValues

Constructor & Destructor Documentation

◆ IntervalOfValues()

evoplex::IntervalOfValues::IntervalOfValues ( int  id,
const QString &  attrName,
Type  type,
const Value min,
const Value max 
)

Constructor.

Parameters
idThe attribute id.
attrNameThe attribute name.
typeThe range type.
minThe smallest value in the range.
maxThe largest value in the range.
See also
AttributeRange::parse

Member Function Documentation

◆ next()

Value evoplex::IntervalOfValues::next ( const Value v) const
inlineoverridevirtual

Gets the value after v.

Parameters
vA value in the attribute range. If v is the last, it returns the first value in the attrRange. if v is not in the attrRange, it returns v.

Implements evoplex::AttributeRangeInterface.

◆ prev()

Value evoplex::IntervalOfValues::prev ( const Value v) const
inlineoverridevirtual

Gets the value before v.

Parameters
vA value in the attribute range. If v is the first, it returns the last value in the attrRange. if v is not in the attrRange, it returns v.

Implements evoplex::AttributeRangeInterface.

◆ rand()

Value evoplex::IntervalOfValues::rand ( PRG prg) const
inlineoverridevirtual

Gets a random value in the attribute range.

Parameters
prgA pointer to a valid PRG.

Implements evoplex::AttributeRangeInterface.


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