use normal distribution on initial random individual creation
initial default range tweaked way down rename "POP" template parameter to "POPSIZE" added RunOneGeneration() method - generations can now be run one at a time added SetRange(i,min,max) method added a decent amount of comments through main algorithm and class declaration
This commit is contained in:
1 parent
c194ae5fc5
commit
6f03c0b106
5 files changed
+267
-113
No files matched your search
+10
@@ -50,6 +50,16 @@ inline double DE::Random::RandDouble(double min, double max)
|
||||
return ( RandDouble() * (max - min) + min );
|
||||
}
|
||||
|
||||
inline double DE::Random::RandGaussian(double mean, double variance)
|
||||
{
|
||||
double sum = 0.0;
|
||||
for (int i=0;i<12;++i)
|
||||
{
|
||||
sum += RandDouble();
|
||||
}
|
||||
return mean + ( variance * ( sum - 6.0 ) );
|
||||
}
|
||||
|
||||
inline DE::u32 DE::Random::RandU32()
|
||||
{
|
||||
return Rand();
|
||||
|
||||
Reference in new issue
Block a user