ECF 1.5
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
Binary::Binary Class Reference

Binary class - implements genotype as a vector of binary coded real values with variable interval and precision. More...

#include <Binary.h>

Inheritance diagram for Binary::Binary:
RealValueGenotype Genotype

Public Member Functions

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

Public Attributes

std::vector< long int > decValue
 integer values of bit representation More...
 
std::vector< v_bool > variables
 vector of bit vectors More...
 
- Public Attributes inherited from RealValueGenotype
std::vector< double > realValue
 vector of floating point values More...
 

Protected Types

typedef std::vector< bool > v_bool
 

Protected Member Functions

double logbase (double a, double base)
 
double round (double, int)
 

Protected Attributes

uint nDecimal_
 number of digits after the decimal point More...
 
uint nBits_
 number of bits for a single dimension More...
 
long potention_
 
bool bRounding_
 use rounding with 'precision' digits on real values in the chromosome More...
 
v_bool vBool_
 temporary bool vector More...
 
- Protected Attributes inherited from RealValueGenotype
double minValue_
 lower bound More...
 
double maxValue_
 upper bound More...
 
uint nDimension_
 dimensionality More...
 
- Protected Attributes inherited from Genotype
std::string name_
 genotype's name More...
 
uint genotypeId_
 this genotype's unique index in individual structure More...
 

Friends

class BinaryMutSimple
 

Detailed Description

Binary class - implements genotype as a vector of binary coded real values with variable interval and precision.

Binary genotype parameters are (the first 3 are inherited from RealValueGenoptype):

Definition at line 38 of file Binary.h.

Member Typedef Documentation

◆ v_bool

typedef std::vector<bool> Binary::Binary::v_bool
protected

Definition at line 45 of file Binary.h.

Constructor & Destructor Documentation

◆ Binary()

Binary::Binary::Binary ( )
inline

Definition at line 55 of file Binary.h.

Member Function Documentation

◆ copy()

Binary * Binary::Binary::copy ( )
inlinevirtual

Create an identical copy of the genotype object.

Implements Genotype.

Definition at line 69 of file Binary.h.

◆ getCrossoverOp()

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

Create and return a vector of crossover operators.

Reimplemented from Genotype.

Definition at line 75 of file Binary.h.

◆ getMutationOp()

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

Create and return a vector of mutation operators.

Reimplemented from Genotype.

Definition at line 92 of file Binary.h.

◆ getNumBits()

uint Binary::Binary::getNumBits ( )
inline

Return number of bits used in a single dimension in real domain.

Definition at line 59 of file Binary.h.

◆ initialize()

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

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

Implements Genotype.

Definition at line 38 of file Binary.cpp.

◆ logbase()

double Binary::Binary::logbase ( double  a,
double  base 
)
protected

Definition at line 9 of file Binary.cpp.

◆ read()

void Binary::Binary::read ( XMLNode &  )
virtual

Read genotype data from XMLNode.

Implements Genotype.

Definition at line 143 of file Binary.cpp.

◆ registerParameters()

void Binary::Binary::registerParameters ( StateP  )
virtual

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

Reimplemented from Genotype.

Definition at line 23 of file Binary.cpp.

◆ round()

double Binary::Binary::round ( double  val,
int  decimals 
)
protected

Definition at line 15 of file Binary.cpp.

◆ update()

bool Binary::Binary::update ( void  )
virtual

Update genotype after genetic material change via genetic operators.

Reimplemented from RealValueGenotype.

Definition at line 108 of file Binary.cpp.

◆ write()

void Binary::Binary::write ( XMLNode &  )
virtual

Write genotype data to XMLNode.

Implements Genotype.

Definition at line 129 of file Binary.cpp.

Friends And Related Function Documentation

◆ BinaryMutSimple

friend class BinaryMutSimple
friend

Definition at line 39 of file Binary.h.

Member Data Documentation

◆ bRounding_

bool Binary::Binary::bRounding_
protected

use rounding with 'precision' digits on real values in the chromosome

Definition at line 44 of file Binary.h.

◆ decValue

std::vector<long int> Binary::Binary::decValue

integer values of bit representation

Definition at line 52 of file Binary.h.

◆ nBits_

uint Binary::Binary::nBits_
protected

number of bits for a single dimension

Definition at line 42 of file Binary.h.

◆ nDecimal_

uint Binary::Binary::nDecimal_
protected

number of digits after the decimal point

Definition at line 41 of file Binary.h.

◆ potention_

long Binary::Binary::potention_
protected

Definition at line 43 of file Binary.h.

◆ variables

std::vector<v_bool> Binary::Binary::variables

vector of bit vectors

Definition at line 53 of file Binary.h.

◆ vBool_

v_bool Binary::Binary::vBool_
protected

temporary bool vector

Definition at line 46 of file Binary.h.


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