I have fixed some bugs and added some tests for doDistrib classes
This commit is contained in:
parent
ebb20c44c5
commit
f2e1e40c30
7 changed files with 41 additions and 11 deletions
1
src/TODO
1
src/TODO
|
|
@ -1 +0,0 @@
|
||||||
* integrer ACP
|
|
||||||
|
|
@ -8,8 +8,10 @@
|
||||||
#ifndef _doDistrib_h
|
#ifndef _doDistrib_h
|
||||||
#define _doDistrib_h
|
#define _doDistrib_h
|
||||||
|
|
||||||
|
#include <eoFunctor.h>
|
||||||
|
|
||||||
template < typename EOT >
|
template < typename EOT >
|
||||||
class doDistrib
|
class doDistrib : public eoFunctorBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Alias for the type
|
//! Alias for the type
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,14 @@
|
||||||
* This class uses the Uniform distribution parameters (bounds) to return
|
* This class uses the Uniform distribution parameters (bounds) to return
|
||||||
* a random position used for population sampling.
|
* a random position used for population sampling.
|
||||||
*/
|
*/
|
||||||
template < typename EOT, class D=doUniform<EOT> >
|
template < typename EOT, class D=doUniform<EOT> > // FIXME: D template name is there really used ?!?
|
||||||
class doSamplerUniform : public doSampler< doUniform< EOT > >
|
class doSamplerUniform : public doSampler< doUniform< EOT > >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef D Distrib;
|
typedef D Distrib;
|
||||||
|
|
||||||
doSamplerUniform(doBounder< EOT > & bounder)
|
doSamplerUniform(doBounder< EOT > & bounder)
|
||||||
: doSampler< doUniform<EOT> >(bounder)
|
: doSampler< doUniform<EOT> >(bounder) // FIXME: Why D is not used here ?
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ SET(SOURCES
|
||||||
t-doEstimatorNormalMulti
|
t-doEstimatorNormalMulti
|
||||||
t-mean-distance
|
t-mean-distance
|
||||||
t-bounderno
|
t-bounderno
|
||||||
|
t-uniform
|
||||||
|
t-continue
|
||||||
)
|
)
|
||||||
|
|
||||||
FOREACH(current ${SOURCES})
|
FOREACH(current ${SOURCES})
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
#include <eo>
|
#include <eo>
|
||||||
#include <do>
|
#include <do>
|
||||||
#include <mo>
|
|
||||||
|
|
||||||
#include <utils/eoLogger.h>
|
|
||||||
#include <utils/eoParserLogger.h>
|
|
||||||
|
|
||||||
#include "Rosenbrock.h"
|
#include "Rosenbrock.h"
|
||||||
#include "Sphere.h"
|
|
||||||
|
|
||||||
typedef eoReal< eoMinimizingFitness > EOT;
|
typedef eoReal< eoMinimizingFitness > EOT;
|
||||||
|
|
||||||
|
|
|
||||||
17
test/t-continue.cpp
Normal file
17
test/t-continue.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#include <eo>
|
||||||
|
#include <do>
|
||||||
|
|
||||||
|
#include "Rosenbrock.h"
|
||||||
|
|
||||||
|
typedef eoReal< eoMinimizingFitness > EOT;
|
||||||
|
typedef doUniform< EOT > Distrib;
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
eoState state;
|
||||||
|
|
||||||
|
doContinue< Distrib >* continuator = new doDummyContinue< Distrib >();
|
||||||
|
state.storeFunctor(continuator);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
16
test/t-uniform.cpp
Normal file
16
test/t-uniform.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#include <eo>
|
||||||
|
#include <do>
|
||||||
|
|
||||||
|
#include "Rosenbrock.h"
|
||||||
|
|
||||||
|
typedef eoReal< eoMinimizingFitness > EOT;
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
eoState state;
|
||||||
|
|
||||||
|
doUniform< EOT >* distrib = new doUniform< EOT >( EOT(3, -1), EOT(3, 1) );
|
||||||
|
state.storeFunctor(distrib);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in a new issue