added example code

added better default range
fixed BIGDOUBLE to be closer to max double (used for default best fitness)
This commit is contained in:
swaits committed 2005-05-20 18:44:51 +00:00
1 parent 6e2d4bf3ca
commit cab0760a99
3 files changed
+49 -2

No files matched your search

+5 -2
View File
@@ -17,7 +17,10 @@ template <unsigned int DIM, unsigned int POP>
const double DE::Engine<DIM,POP>::DEFAULTCROSSOVER = 1.0;
template <unsigned int DIM, unsigned int POP>
const double DE::Engine<DIM,POP>::BIGDOUBLE = 1.0e30;
const double DE::Engine<DIM,POP>::DEFAULTRANGE= 1000000.0;
template <unsigned int DIM, unsigned int POP>
const double DE::Engine<DIM,POP>::BIGDOUBLE = 9.0e300; // close to max double
template <unsigned int DIM, unsigned int POP>
inline DE::Engine<DIM,POP>::Engine()
@@ -27,7 +30,7 @@ inline DE::Engine<DIM,POP>::Engine()
for ( unsigned int i=0;i<DIM;i++ )
{
this->minimum[i] = -BIGDOUBLE;
this->minimum[i] = -DEFAULTRANGE;
this->maximum[i] = -(this->minimum[i]);
}