00001
00020 #ifndef _DOMAIN_H
00021
00022 #define _DOMAIN_H 1
00023
00024 #include "real.h"
00025 #include "random.h"
00026
00027 namespace realea {
00036 class DomainReal {
00037 public:
00045 DomainReal(unsigned int dim);
00046 ~DomainReal(void);
00047
00057 void setValues(unsigned int gen, tReal min, tReal max,bool check=true);
00058
00066 void setSearchDomain(bool *searchDim, int dim);
00067
00072 void getSearchDomain(bool *searchDim, int dim);
00073
00082 void getValues(unsigned int gen, tReal *pmin, tReal *pmax, bool check=true);
00083
00091 bool canBeChanged(unsigned dim);
00092
00103 tReal clip(unsigned int gen, tReal value, bool check=true);
00104
00114 void setDomainCenter(tChromosomeReal center, double scale);
00115
00121 void clip(tChromosomeReal &crom);
00122
00129 bool check(const tChromosomeReal &crom);
00130
00137 void getInit(Random *random, tChromosomeReal &crom);
00138
00142 unsigned getDimension(void) {
00143 return m_dim;
00144 }
00145
00150 void setBounds(void) {
00151 m_isbound = true;
00152 }
00153
00154 void setNotBounds(void) {
00155 m_isbound = false;
00156 }
00157
00158 bool isBound() {
00159 return m_isbound;
00160 }
00161
00162 private:
00169 void getInitRandom(Random *random, tChromosomeReal &crom);
00170
00174 void checkGen(unsigned int gen);
00175 tChromosomeReal m_mins;
00176 tChromosomeReal m_maxs;
00177 unsigned int m_dim;
00178 bool m_isbound;
00179 unsigned m_search_ini;
00180 unsigned m_search_fin;
00181
00182 bool *m_check_dim;
00183 };
00184
00185 typedef DomainReal* DomainRealPtr;
00186
00187 }
00188 #endif