ECF 1.5
AlgRandomSearch.cpp
1#include "ECF_base.h"
2#include "AlgRandomSearch.h"
3#include "ECF_macro.h"
4
5
6RandomSearch :: RandomSearch()
7{
8 name_ = "RandomSearch";
9}
10
11
13{
14}
15
16
18{
19 return true;
20}
21
22
23bool RandomSearch :: advanceGeneration(StateP state, DemeP deme)
24{
25 // initialize and evaluate all individuals
26 for(uint i = 0; i < deme->size(); i++) {
27 deme->at(i)->initialize(state);
28 evaluate(deme->at(i));
29 }
30
31 return true;
32}
std::string name_
algorithm name
Definition: Algorithm.h:23
void evaluate(IndividualP ind)
Helper function: evaluate an individual.
Definition: Algorithm.h:157
void registerParameters(StateP state)
Register algorithm's parameters (if any).
bool advanceGeneration(StateP state, DemeP deme)
Perform a single generation on a single deme.
bool initialize(StateP state)
Initialize the algorithm, read parameters from the system, do a sanity check.