TypedEvoParam A class for defining evolutionary-optimizable parameters. They can be registered in EvoScripts for the evolutionary optimization functionality. The template type @T defines type of possible values the parameter may store. As T you have to either use a trivially destructible object or a smart pointer that will delete itself when it goes out of scope.
More...
#include <TypedEvoParam.hh>
|
| TypedEvoParam (std::initializer_list< T > argsDomain) |
| TypedEvoParam - Constructor. More...
|
|
| TypedEvoParam (std::vector< T > &argsDomain) |
| TypedEvoParam - Constructor. More...
|
|
int | IndexOfValue (T value) |
| IndexOfValue - finds a given value in the parameter's domain and returns its index. More...
|
|
const T | Value () const |
| Value - gets the current value that the parameter is holding. More...
|
|
| operator T () const |
|
virtual std::string | ToString () const override |
| ToString - returns the string representation of the current value hold by the parameter. More...
|
|
void | Randomize (std::mt19937_64 &rand_gen) |
| Sets to a random possible value from a domain. More...
|
|
const EvoParam * | SetNext () |
| Sets to the next possible value in the domain (wrapped, i.e. last.next -> first) and returns itself.
|
|
const EvoParam * | SetPrev () |
| Sets to the previous possible value in the domain (wrapped, i.e. first.prev -> last) and returns itself.
|
|
const EvoParam * | SetNextClamped () |
| Sets to the next possible value in the domain (clamped, i.e. last.next -> last) and returns itself.
|
|
const EvoParam * | SetPrevClamped () |
| Sets to the previous possible value in the domain (clamped, i.e. first.prev -> first) and returns itself.
|
|
float | GetNormalizedPositionWeight () const |
| Returns the normalized position as [0.0, 1.0] floating point number.
|
|
size_t | GetPositionIndex () const |
| Returns the position of the parameter i.e. the index of the currently assigned element from the domain.
|
|
void | SetPositionIndex (size_t position) |
| Sets the position of the parameter i.e. the index of the currently assigned element from the domain. More...
|
|
template<class T>
class grail::evolution::TypedEvoParam< T >
TypedEvoParam A class for defining evolutionary-optimizable parameters. They can be registered in EvoScripts for the evolutionary optimization functionality. The template type @T defines type of possible values the parameter may store. As T you have to either use a trivially destructible object or a smart pointer that will delete itself when it goes out of scope.
◆ TypedEvoParam() [1/2]
◆ TypedEvoParam() [2/2]
◆ IndexOfValue()
IndexOfValue - finds a given value in the parameter's domain and returns its index.
- Returns
- index of the value found.
◆ operator T()
Expicit cast so you can use constructions such as: TypedEvoParam<int> speed({10,15,20}) if(speed > 2) .... */
◆ ToString()
ToString - returns the string representation of the current value hold by the parameter.
Reimplemented from grail::evolution::EvoParam.
◆ Value()
Value - gets the current value that the parameter is holding.
- Returns
- current value.
The documentation for this class was generated from the following file: