BaseEvoParam - A class that represents a parameter that is modifiable (optimizable) by evolutionary algorithms.
Unless your parameter is only a positional index (represented by an integer from 0 to max), use a specialized version 'EvoParam<Type>'.
These parameters form an encoding and are stored as member Fields or Properties in an 'Individual' and set as optimizable using 'Individual::SetMemberParameterOptimizable'.
Typically, the 'Individual.SetMemberParameterOptimizable' function should be called in the constructor of an 'Individual'-derived class.
More...
#include <EvoParam.hh>
BaseEvoParam - A class that represents a parameter that is modifiable (optimizable) by evolutionary algorithms.
Unless your parameter is only a positional index (represented by an integer from 0 to max), use a specialized version 'EvoParam<Type>'.
These parameters form an encoding and are stored as member Fields or Properties in an 'Individual' and set as optimizable using 'Individual::SetMemberParameterOptimizable'.
Typically, the 'Individual.SetMemberParameterOptimizable' function should be called in the constructor of an 'Individual'-derived class.
◆ BaseEvoParam()
grail::evolution::BaseEvoParam::BaseEvoParam |
( |
size_t |
domainLength | ) |
|
BaseEvoParam - Constructor.
- Parameters
-
domainLength | - the number of distinct values this parameter may take. |
◆ GetNormalizedPositionWeight()
float grail::evolution::BaseEvoParam::GetNormalizedPositionWeight |
( |
| ) |
const |
The normalized position, between 0.0 and 1.0, is the ratio of the current position index to the domainLength.
- Returns
- - the normalized position.
◆ GetPositionIndex()
size_t grail::evolution::BaseEvoParam::GetPositionIndex |
( |
| ) |
const |
Returns the position of the parameter. BaseEvoParam uses PositionIndex to point to an element from its domain.
- Returns
- Index of the currently assigned element from the domain as value.
◆ Randomize()
void grail::evolution::BaseEvoParam::Randomize |
( |
std::mt19937_64 & |
rand_gen | ) |
|
Sets to a random possible value from a domain.
- Parameters
-
rand_gen | - random number generator. |
◆ SetNext()
const BaseEvoParam * grail::evolution::BaseEvoParam::SetNext |
( |
| ) |
|
Sets to the next possible value in the domain (wrapped, i.e. last.next -> first).
- Returns
- - the BaseEvoParam returns a pointer to itself.
◆ SetNextClamped()
const BaseEvoParam * grail::evolution::BaseEvoParam::SetNextClamped |
( |
| ) |
|
Sets to the next possible value in the domain (clamped, i.e. last.next -> last).
- Returns
- - the BaseEvoParam returns a pointer to itself.
◆ SetPositionIndex()
void grail::evolution::BaseEvoParam::SetPositionIndex |
( |
size_t |
position | ) |
|
Sets the position of the parameter. Setting this index makes the parameter hold the PositionIndex-ith value from the domain. Index starts at zero.
- Parameters
-
position | - the number >= 0 and < domainLength. |
◆ SetPrev()
const BaseEvoParam * grail::evolution::BaseEvoParam::SetPrev |
( |
| ) |
|
Sets to the previous possible value in the domain (wrapped, i.e. first.prev -> last).
- Returns
- - the BaseEvoParam returns a pointer to itself.
◆ SetPrevClamped()
const BaseEvoParam * grail::evolution::BaseEvoParam::SetPrevClamped |
( |
| ) |
|
Sets to the previous possible value in the domain (clamped, i.e. first.prev -> first).
- Returns
- - the BaseEvoParam returns a pointer to itself.
The documentation for this class was generated from the following files: