Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Gen Class Reference

The Gen class. More...

#include <Gen.h>

Collaboration diagram for Gen:

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...
 
IValuegetValue (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...
 
GenPrototypegetPrototype (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

IValuem_value
 (IValue*) The value of the Gen. More...
 
GenPrototypem_prototype
 (GenPrototyp*) The prototype of the Gen. More...
 
int m_ID
 (int) The ID of the Gen. More...
 

Detailed Description

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!

Constructor & Destructor Documentation

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.

Parameters
prototype(GenPrototype*) Pointer to the prototype.
id(int) ID of the gen
~Gen ( void  )
virtual

destructor to delete a gen.

Member Function Documentation

int getID ( void  ) const
inline

[inline], [const] This function gives the ID of the Gen back.

Returns
(int) The ID
std::string getName ( void  ) const

[const] This function gives the Name of this Gen (name of the prototype) back.

Returns
(string) Name of the Gen.
GenPrototype * getPrototype ( void  ) const

[const] This function gives the prototype of the Gen back.

Returns
(GenPrototyp*) The prototype
IValue* getValue ( void  ) const
inline

[inline], [const] This function gives the value which is saved in the Gen back.

Returns
(IValue*) The value
void setValue ( IValue value)
inline

[inline] This function change the saved pointer to the IValue.

So the Gen changed his value.

Parameters
value(IVaue*) the new Value
bool store ( FILE *  f) const

store the gene in a file

Parameters
f(FILE*) the file to store
Returns
(bool) true if all ok
std::string toString ( bool  onlyValue = true) const

[const] This function returns a string representation of this Gen.

Returns
(string) The Gen in string - Form

Member Data Documentation

int m_ID
protected

(int) The ID of the Gen.

The ID is individual. Every Gen has his own.

GenPrototype* m_prototype
protected

(GenPrototyp*) The prototype of the Gen.

After creating unchangeable.

IValue* m_value
protected

(IValue*) The value of the Gen.


The documentation for this class was generated from the following files: