14#ifndef RBTCHROMELEMENT_H_
15#define RBTCHROMELEMENT_H_
17#include "rxdock/Config.h"
18#include "rxdock/Rand.h"
29typedef std::vector<double> XOverElement;
30typedef XOverElement::iterator XOverElementIter;
31typedef XOverElement::const_iterator XOverElementConstIter;
32typedef std::vector<XOverElement> XOverList;
33typedef XOverList::iterator XOverListIter;
34typedef XOverList::const_iterator XOverListConstIter;
39 static const std::string _CT;
41 static double _THRESHOLD;
43 RBTDLL_EXPORT
static double &GetThreshold();
48 enum eMode { FIXED = 0, TETHERED = 1, FREE = 2 };
50 static eMode StrToMode(
const std::string &modeStr);
51 static std::string RBTDLL_EXPORT
52 ModeToStr(eMode mode);
60 virtual void Reset() = 0;
62 virtual void Randomise() = 0;
65 virtual void Mutate(
double relStepSize) = 0;
67 virtual void SyncFromModel() = 0;
69 virtual void SyncToModel() = 0;
76 virtual int GetLength()
const = 0;
81 virtual int GetXOverLength()
const = 0;
85 virtual void GetVector(std::vector<double> &v)
const = 0;
89 virtual void GetVector(XOverList &v)
const = 0;
94 virtual void SetVector(
const std::vector<double> &v,
int &i) = 0;
99 virtual void SetVector(
const XOverList &v,
int &i) = 0;
102 virtual void GetStepVector(std::vector<double> &v)
const = 0;
109 virtual double CompareVector(
const std::vector<double> &v,
int &i)
const = 0;
116 virtual void Print(std::ostream &s)
const {}
120 Rand &GetRand()
const {
return m_rand; }
121 void CauchyMutate(
double mean,
double variance);
125 RBTDLL_EXPORT
double Compare(
const ChromElement &c)
const;
129 bool Equals(
const ChromElement &c,
double threshold)
const;
132 void SetVector(
const std::vector<double> &v);
135 void SetVector(
const XOverList &v);
138 RBTDLL_EXPORT
friend bool operator==(
const ChromElement &c1,
140 RBTDLL_EXPORT
friend bool operator!=(
const ChromElement &c1,
143 RBTDLL_EXPORT
friend std::ostream &operator<<(std::ostream &s,
153 bool VectorOK(
const std::vector<double> &v,
unsigned int i)
const;
157 bool VectorOK(
const XOverList &v,
unsigned int i)
const;
164typedef std::vector<ChromElement *>
166typedef ChromElementList::iterator ChromElementListIter;
167typedef ChromElementList::const_iterator ChromElementListConstIter;
171std::ostream &operator<<(std::ostream &s,
const ChromElement &c);
Definition ChromElement.h:36
Definition SmartPointer.h:48