Loading...
Searching...
No Matches
genes.h
Go to the documentation of this file.
// ----------------------------------------------------
// $Maintainer: Marcel Schumann $
// $Authors: Jan Fuhrmann, Marcel Schumann $
// ----------------------------------------------------
#ifndef BALL_DOCKING_GENETICDOCK_GENES_H
#define BALL_DOCKING_GENETICDOCK_GENES_H
#include <BALL/MATHS/quaternion.h>
#include <vector>
#include <random>
namespace BALL
{
class BALL_EXPORT BALL_DEPRECATED GenericGene
{
public:
GenericGene();
virtual ~GenericGene(){};
virtual GenericGene* mate(GenericGene* gg) = 0;
virtual void mutate() = 0;
virtual GenericGene* clone() = 0;
virtual void randomize() = 0;
protected:
double randomGeneValue();
int randomGenePosition(int from, int to);
private:
std::mt19937 rng_;
std::uniform_real_distribution<double> dist_;
};
class BALL_EXPORT BALL_DEPRECATED DoubleGene: public GenericGene
{
public:
DoubleGene();
virtual ~DoubleGene();
DoubleGene(Size i);
virtual GenericGene *mate(GenericGene * gg);
virtual void mutate();
std::vector<double> getValues();
void setValue(std::vector<double> v);
virtual GenericGene *clone();
void randomize();
private:
std::vector<double> values_;
};
class BALL_EXPORT BALL_DEPRECATED QuaternionGene: public GenericGene
{
public:
QuaternionGene();
virtual ~QuaternionGene();
virtual GenericGene *mate(GenericGene *gg);
virtual void mutate();
Quaternion getValue();
virtual GenericGene *clone();
void randomize();
private:
Quaternion quat_;
};
}
#endif /* BALL_DOCKING_GENETICDOCK_GENES_H */
BALL_DEPRECATED
#define BALL_DEPRECATED
Definition COMMON/global.h:64
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::DoubleGene::mutate
virtual void mutate()
BALL::DoubleGene::getValues
std::vector< double > getValues()
BALL::DoubleGene::~DoubleGene
virtual ~DoubleGene()
BALL::DoubleGene::randomize
void randomize()
BALL::DoubleGene::DoubleGene
DoubleGene(Size i)
BALL::DoubleGene::clone
virtual GenericGene * clone()
BALL::DoubleGene::setValue
void setValue(std::vector< double > v)
BALL::DoubleGene::DoubleGene
DoubleGene()
BALL::DoubleGene::mate
virtual GenericGene * mate(GenericGene *gg)
BALL::GenericGene::randomize
virtual void randomize()=0
BALL::GenericGene::mutate
virtual void mutate()=0
BALL::GenericGene::clone
virtual GenericGene * clone()=0
BALL::GenericGene::randomGenePosition
int randomGenePosition(int from, int to)
BALL::GenericGene::~GenericGene
virtual ~GenericGene()
Definition genes.h:28
BALL::GenericGene::mate
virtual GenericGene * mate(GenericGene *gg)=0
BALL::GenericGene::GenericGene
GenericGene()
BALL::GenericGene::randomGeneValue
double randomGeneValue()
BALL::QuaternionGene::QuaternionGene
QuaternionGene()
BALL::QuaternionGene::clone
virtual GenericGene * clone()
BALL::QuaternionGene::mutate
virtual void mutate()
BALL::QuaternionGene::mate
virtual GenericGene * mate(GenericGene *gg)
BALL::QuaternionGene::randomize
void randomize()
BALL::QuaternionGene::getValue
Quaternion getValue()
BALL::QuaternionGene::~QuaternionGene
virtual ~QuaternionGene()
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Quaternion
TQuaternion< float > Quaternion
Definition quaternion.h:626
quaternion.h