|
Grail (C++)
1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
|
3 #ifndef GRAIL_EVO_PARAM_H
4 #define GRAIL_EVO_PARAM_H
31 void Randomize(std::mt19937_64& rand_gen);
62 virtual std::string
ToString()
const;
97 domain.reserve(argsDomain.size());
98 std::copy(argsDomain.begin(), argsDomain.end(), std::back_inserter(domain));
108 domain.reserve(argsDomain.size());
109 std::copy(argsDomain.begin(), argsDomain.end(), std::back_inserter(domain));
130 std::vector<T> domain{};
134 #endif //GRAIL_EVO_PARAM_H
BaseEvoParam - A class that represents a parameter that is modifiable (optimizable) by evolutionary a...
Definition: EvoParam.hh:20
float GetNormalizedPositionWeight() const
The normalized position, between 0.0 and 1.0, is the ratio of the current position index to the domai...
Definition: EvoParam.cpp:55
EvoParam(std::initializer_list< T > argsDomain)
Constructs a new EvoParam instance with the given possible values.
Definition: EvoParam.hh:94
EvoParam A class for defining evolutionary-optimizable parameters. They can be registered in Individu...
Definition: EvoParam.hh:87
const BaseEvoParam * SetPrevClamped()
Sets to the previous possible value in the domain (clamped, i.e. first.prev -> first).
Definition: EvoParam.cpp:41
size_t GetPositionIndex() const
Returns the position of the parameter. BaseEvoParam uses PositionIndex to point to an element from it...
Definition: EvoParam.cpp:60
const size_t domainLength
domainLength - the number of distinct values BaseEvoParam may take.
Definition: EvoParam.hh:71
const BaseEvoParam * SetPrev()
Sets to the previous possible value in the domain (wrapped, i.e. first.prev -> last).
Definition: EvoParam.cpp:21
EvoParam(std::vector< T > &argsDomain)
Constructs a new EvoParam instance with the given possible values.
Definition: EvoParam.hh:105
BaseEvoParam(size_t domainLength)
BaseEvoParam - Constructor.
Definition: EvoParam.cpp:80
void SetPositionIndex(size_t position)
Sets the position of the parameter. Setting this index makes the parameter hold the PositionIndex-ith...
Definition: EvoParam.cpp:65
void Randomize(std::mt19937_64 &rand_gen)
Sets to a random possible value from a domain.
Definition: EvoParam.cpp:10
const T Value() const
Value - gets the current value that the parameter is holding.
Definition: EvoParam.hh:116
size_t GetDomainLength() const
Gets the number of distinct values BaseEvoParam may take.
Definition: EvoParam.cpp:75
const BaseEvoParam * SetNext()
Sets to the next possible value in the domain (wrapped, i.e. last.next -> first).
Definition: EvoParam.cpp:15
const BaseEvoParam * SetNextClamped()
Sets to the next possible value in the domain (clamped, i.e. last.next -> last).
Definition: EvoParam.cpp:35
virtual std::string ToString() const
ToString - returns a string representation of the current value hold by the parameter.
Definition: EvoParam.cpp:70