Esempio n. 1
0
// Here are a few termination functions that you can use.  Terminators return
// gaTrue if the algorithm should finish, gaFalse otherwise.
GABoolean
GAGeneticAlgorithm::TerminateUponGeneration(GAGeneticAlgorithm & ga){
  return(ga.generation() < ga.nGenerations() ? gaFalse : gaTrue);
}
Esempio n. 2
0
void TwitterAnnounce::action(const GAGeneticAlgorithm & ga) {
    std::string generation = stringFrom(ga.generation());
    // todo get from config
    announcer_->announceGeneration("Generation " + generation + " created! #megapolis", "","http://nynex.hydrogenproject.com/rate.php");
}