Gen Class Reference

The Gen class. More...

#include <Gen.h>

Collaboration diagram for Gen:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Gen (GenPrototype *prototype, int id)
 constructor to create a gen.
virtual ~Gen (void)
 destructor to delete a gen.
std::string getName (void) const
 [const] This function gives the Name of this Gen (name of the prototype) back.
IValuegetValue (void) const
 [inline], [const] This function gives the value which is saved in the Gen back.
void setValue (IValue *value)
 [inline] This function change the saved pointer to the IValue.
int getID (void) const
 [inline], [const] This function gives the ID of the Gen back.
GenPrototypegetPrototype (void) const
 [const] This function gives the prototype of the Gen back.
std::string toString (bool onlyValue=true) const
 [const] This function returns a string representation of this Gen.
bool store (FILE *f) const
 store the gene in a file

Protected Attributes

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

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:
Generated on Fri Oct 30 16:29:02 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7