|
Evoplex
0.2.1
|
The SetOfValues class. More...
#include <attributerange.h>
Public Member Functions | |
| SetOfValues (int id, const QString &attrName, Type type, Values values) | |
| Constructor. More... | |
| ~SetOfValues () override=default | |
| Destructor. | |
| const Values & | values () const |
| Gets the vector of values. | |
| 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 Value & | min () const |
| Gets the minimum value in the range. | |
| const Value & | max () 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 |
The SetOfValues class.
It handles the 'attribute ranges' defined by a set of values, e.g., AttributeRange::Double_Set, AttributeRange::Int_Set and AttributeRange::String_Set.
| evoplex::SetOfValues::SetOfValues | ( | int | id, |
| const QString & | attrName, | ||
| Type | type, | ||
| Values | values | ||
| ) |
Constructor.
| id | The attribute id. |
| attrName | The attribute name. |
| type | The range type. |
| values | A vector of Value. |
Gets the value after v.
| v | A 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.
Gets the value before v.
| v | A 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.
Gets a random value in the attribute range.
| prg | A pointer to a valid PRG. |
Implements evoplex::AttributeRangeInterface.
1.8.14