World_select.hpp

Functions for popular selection methods applied to worlds.

Functions

template<typename ORG>
void EliteSelect(World<ORG> &world, size_t e_count = 1, size_t copy_count = 1)

==ELITE== Selection picks a set of the most fit individuals from the population to move to the next generation. Find top e_count individuals and make copy_count copies of each.

Parameters:
  • world – The World object with the organisms to be selected.

  • e_count – How many distinct organisms should be chosen, starting from the most fit.

  • copy_count – How many copies should be made of each elite organism?

template<typename ORG>
void RandomSelect(World<ORG> &world, size_t r_count = 1, size_t copy_count = 1)

==RANDOM== Selection picks an organism with uniform-random probability form the populaiton.

Parameters:
  • world – The World object with the organisms to be selected.

  • r_count – How many distinct organisms should be chosen?

  • copy_count – How many copies should be made of each chosen organism?

template<typename ORG>
void TournamentSelect(World<ORG> &world, size_t t_size, size_t tourny_count = 1)

==TOURNAMENT== Selection creates a tournament with a random sub-set of organisms, finds the one with the highest fitness, and moves it to the next generation. User provides the world (with a fitness function), the tournament size, and (optionally) the number of tournaments to run.

Parameters:
  • world – The World object with the organisms to be selected.

  • t_size – How many organisms should be placed in each tournament?

  • tourny_count – How many tournaments should be run? (with replacement of organisms)

template<typename ORG>
void LocalTournamentSelect(World<ORG> &world, size_t t_size, size_t tourny_count = 1)

==LOCAL TOURNAMENT== Selection creates a tournament with a random sub-set of organisms that are neighbor to a random organism, finds the one with the highest fitness, and moves it to the next generation. User provides the world (with a fitness function), the tournament size, and (optionally) the number of tournaments to run.

Parameters:
  • world – The World object with the organisms to be selected.

  • t_size – How many organisms should be placed in each tournament?

  • tourny_count – How many tournaments should be run? (with replacement of organisms)

template<typename ORG>
void RouletteSelect(World<ORG> &world, size_t count = 1)

==ROULETTE== Selection (aka Fitness-Proportional Selection) chooses organisms to reproduce based on their current fitness.

Parameters:
  • world – The World object with the organisms to be selected.

  • count – How many organims should be selected for replication? (with replacement)

template<typename T, typename ...ARGS>
void EMPCall_TriggerOnLexicaseSelect(bool_decoy<decltype(&T::TriggerOnLexicaseSelect)>, T &target, ARGS&&... args)
template<typename T, typename ...ARGS>
void EMPCall_TriggerOnLexicaseSelect(int, T&, ARGS...)
template<typename T, typename ...ARGS>
void TriggerOnLexicaseSelect(T &target, ARGS&&... args)
template<typename ORG>
void LexicaseSelect(World<ORG> &world, const vector<std::function<double(const ORG&)>> &fit_funs, size_t repro_count = 1, size_t max_funs = 0)

==LEXICASE== Selection runs through multiple fitness functions in a random order for EACH offspring produced.

Parameters:
  • world – The World object with the organisms to be selected.

  • fit_funs – The set of fitness functions to shuffle for each organism reproduced.

  • repro_count – How many rounds of replication should we do. (default 1)

  • max_funs – The maximum number of fitness functions to use. (use 0 for all; default)

template<typename ORG>
void OptimizedLexicaseSelect(World<ORG> &world, const vector<std::function<double(const ORG&)>> &fit_funs, size_t repro_count = 1, size_t max_funs = 0)

==OPTIMIZED LEXICASE== Is the same as regular lexicase, but determines how many unique genotypes there are

Parameters:
  • world – The World object with the organisms to be selected.

  • fit_funs – The set of fitness functions to shuffle for each organism reproduced.

  • repro_count – How many rounds of repliction should we do. (default 1)

  • max_funs – The maximum number of fitness functions to use. (use 0 for all; default)

template<typename ORG>
void EcoSelect(World<ORG> &world, const vector<std::function<double(ORG&)>> &extra_funs, const vector<double> &pool_sizes, size_t t_size, size_t tourny_count = 1)
template<typename ORG>
void EcoSelect(World<ORG> &world, const vector<typename World<ORG>::fun_calc_fitness_t> &extra_funs, double pool_sizes, size_t t_size, size_t tourny_count = 1)

EcoSelect can be provided a single value if all pool sizes are identical.

Variables

int ignore_semicolon_to_follow_TriggerOnLexicaseSelect = 0