00001
00020 #include "problemeasy.h"
00021 #include "functions.h"
00022
00023 using namespace realea;
00024
00025 ProblemEasy::ProblemEasy(unsigned int dim) {
00026 m_ndim = dim;
00027 }
00028
00029 ProblemEasy::~ProblemEasy(void) {
00030 }
00031
00032 ProblemPtr ProblemEasy::get(unsigned int fun) {
00033 ProblemPtr prob (new Problem());
00034 prob->setDimension(m_ndim);
00035 double min = -2.56;
00036 double max = 5.12;
00037
00038 for (unsigned i = 0; i < m_ndim; ++i) {
00039 prob->setDomainValues(i, min, max, true);
00040 }
00041
00042 prob->setOptimize(0, 0);
00043 prob->setMaxEval(100000);
00044 prob->setMinimize();
00045
00046
00047 prob->setEval(sphere);
00048
00049 return prob;
00050 }