ECF 1.7
IntGenotype::IntGenotype Class Reference

IntGenotype class - implements genotype as a vector of int values. More...

#include <IntGenotype.h>

Inheritance diagram for IntGenotype::IntGenotype:
Genotype

Public Member Functions

IntGenotype * copy ()
 Create an identical copy of the genotype object.
int getLBound ()
 return lower bound of the defined interval
int getUBound ()
 return upper bound of the defined interval
std::vector< CrossoverOpP > getCrossoverOp ()
 Create and return a vector of crossover operators.
std::vector< MutationOpP > getMutationOp ()
 Create and return a vector of mutation operators.
void registerParameters (StateP state)
 Register genotype's parameters (called before Genotype::initialize).
bool initialize (StateP state)
 Initialize a genotype object (read parameters, perform sanity check, build data).
void write (XMLNode &xIntGenotype)
 Write genotype data to XMLNode.
void read (XMLNode &xIntGenotype)
 Read genotype data from XMLNode.
Public Member Functions inherited from Genotype
bool registerParameter (StateP state, std::string name, voidP value, enum ECF::type T, std::string description="")
 Register a single parameter.
voidP getParameterValue (StateP state, std::string name)
 Read single parameter value from Registry.
bool setParameterValue (StateP state, std::string name, voidP value)
 Write single parameter value to Registry.
bool isParameterDefined (StateP state, std::string name)
 Check if parameter is defined in the configuration.
virtual uint getGenomeSize ()
std::string getName ()
 Return genotype's name (each genotype is uniquely identified with its name).
uint getGenotypeId ()
 Return this genotype's index in individual structure.
void setGenotypeId (uint id)
 Set genotype index in an individual.
std::string toString ()
 Output genotype to string.

Public Attributes

int minValue_
int maxValue_
uint nSize_
std::vector< int > intValues

Additional Inherited Members

Protected Attributes inherited from Genotype
std::string name_
 genotype's name
uint genotypeId_
 this genotype's unique index in individual structure

Detailed Description

IntGenotype class - implements genotype as a vector of int values.

IntGenotype parameters are:

  • lbound: lower bound of vector values
  • ubound: upper bound of vector values
  • size: int vector size

Definition at line 27 of file IntGenotype.h.

Constructor & Destructor Documentation

◆ IntGenotype()

IntGenotype::IntGenotype::IntGenotype ( )
inline

Definition at line 34 of file IntGenotype.h.

Member Function Documentation

◆ copy()

IntGenotype * IntGenotype::IntGenotype::copy ( )
inlinevirtual

Create an identical copy of the genotype object.

Implements Genotype.

Definition at line 39 of file IntGenotype.h.

◆ getCrossoverOp()

std::vector< CrossoverOpP > IntGenotype::IntGenotype::getCrossoverOp ( )
inlinevirtual

Create and return a vector of crossover operators.

Reimplemented from Genotype.

Definition at line 56 of file IntGenotype.h.

◆ getLBound()

int IntGenotype::IntGenotype::getLBound ( )
inline

return lower bound of the defined interval

Definition at line 46 of file IntGenotype.h.

◆ getMutationOp()

std::vector< MutationOpP > IntGenotype::IntGenotype::getMutationOp ( )
inlinevirtual

Create and return a vector of mutation operators.

Reimplemented from Genotype.

Definition at line 65 of file IntGenotype.h.

◆ getUBound()

int IntGenotype::IntGenotype::getUBound ( )
inline

return upper bound of the defined interval

Definition at line 52 of file IntGenotype.h.

◆ initialize()

bool IntGenotype::IntGenotype::initialize ( StateP state)
virtual

Initialize a genotype object (read parameters, perform sanity check, build data).

Implements Genotype.

Definition at line 16 of file IntGenotype.cpp.

◆ read()

void IntGenotype::IntGenotype::read ( XMLNode & xIntGenotype)
virtual

Read genotype data from XMLNode.

Implements Genotype.

Definition at line 67 of file IntGenotype.cpp.

◆ registerParameters()

void IntGenotype::IntGenotype::registerParameters ( StateP state)
virtual

Register genotype's parameters (called before Genotype::initialize).

Reimplemented from Genotype.

Definition at line 9 of file IntGenotype.cpp.

◆ write()

void IntGenotype::IntGenotype::write ( XMLNode & xIntGenotype)
virtual

Write genotype data to XMLNode.

Implements Genotype.

Definition at line 53 of file IntGenotype.cpp.

Member Data Documentation

◆ intValues

std::vector<int> IntGenotype::IntGenotype::intValues

Definition at line 32 of file IntGenotype.h.

◆ maxValue_

int IntGenotype::IntGenotype::maxValue_

Definition at line 30 of file IntGenotype.h.

◆ minValue_

int IntGenotype::IntGenotype::minValue_

Definition at line 30 of file IntGenotype.h.

◆ nSize_

uint IntGenotype::IntGenotype::nSize_

Definition at line 31 of file IntGenotype.h.


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