Robot Simulator of the Robotics Group for Self-Organization of Control
0.8.0
|
#include <Gen.h>
Public Member Functions | |
Gen (GenPrototype *prototype, int id) | |
constructor to create a gen. More... | |
virtual | ~Gen (void) |
destructor to delete a gen. More... | |
std::string | getName (void) const |
[const] This function gives the Name of this Gen (name of the prototype) back. More... | |
IValue * | getValue (void) const |
[inline], [const] This function gives the value which is saved in the Gen back. More... | |
void | setValue (IValue *value) |
[inline] This function change the saved pointer to the IValue. More... | |
int | getID (void) const |
[inline], [const] This function gives the ID of the Gen back. More... | |
GenPrototype * | getPrototype (void) const |
[const] This function gives the prototype of the Gen back. More... | |
std::string | toString (bool onlyValue=true) const |
[const] This function returns a string representation of this Gen. More... | |
bool | store (FILE *f) const |
store the gene in a file More... | |
Protected Attributes | |
IValue * | m_value |
(IValue*) The value of the Gen. More... | |
GenPrototype * | m_prototype |
(GenPrototyp*) The prototype of the Gen. More... | |
int | m_ID |
(int) The ID of the Gen. More... | |
The Gen class.
This class is used for representing one gen in the gen. alg. It has one ID which make it individual and an name (string) which group it with other gens to a gen pool. Also it has a IValue which is used to save the real value. An IValue can be a number, a matrix, a 3D Modell or something else.
Places for saving the gen inside the gen. alg. are the GenContext, the Individual and the GenEngine. Deleting only in the GenEngine!
Gen | ( | GenPrototype * | prototype, |
int | id | ||
) |
constructor to create a gen.
Information which the class need are the prototype (name an group of gens) and the id, which the gen identified.
prototype | (GenPrototype*) Pointer to the prototype. |
id | (int) ID of the gen |
|
virtual |
destructor to delete a gen.
|
inline |
[inline], [const] This function gives the ID of the Gen back.
std::string getName | ( | void | ) | const |
GenPrototype * getPrototype | ( | void | ) | const |
[const] This function gives the prototype of the Gen back.
|
inline |
[inline], [const] This function gives the value which is saved in the Gen back.
|
inline |
bool store | ( | FILE * | f | ) | const |
store the gene in a file
f | (FILE*) the file to store |
std::string toString | ( | bool | onlyValue = true | ) | const |
|
protected |
(GenPrototyp*) The prototype of the Gen.
After creating unchangeable.