Selecting individuals
A crucial aspect of genetic algorithms is the selection operator. The selection operator is used to chose individuals from the population for crossover and mutation. Many of the well known selection operators from the GA literature are available through GAUL. In addition to the built-in selection operators, it is simple to use your own.
There are two types of selection operators in GAUL, one type selects single individuals while the other selects pairs of individuals. All selection operators share one of the following prototypes:
/* GAselect_one selects a single entity from the population. */
typedef boolean (*GAselect_one)(population *pop, entity **mother);
/* GAselect_one selects a pair of entities from the population. */
typedef boolean (*GAselect_two)(population *pop, entity **mother, entity **father);
You may specify your prefered algorithm simply by passing a reference to the relevent functions into the genesis function.
Built-in selection operators
The following tables list the built-in selection operators.
Single selection functions | brief description |
ga_select_one_random() | Select entity at random |
ga_select_one_every() | Sequentially select each entity |
ga_select_one_randomrank() | Select entity at random where probability is a linear function of rank |
ga_select_one_bestof2() | Select entity by pairwise tournament |
ga_select_one_roulette() | Select entity by stochastic, roulette-wheel, approach | |
ga_select_one_sus() | Select entity by Stochastic Universal Sampling | |
ga_select_one_aggressive() | Select entity at random where probability is an exponential function of rank | |
ga_select_one_best() | Always select the single fittest entity | |
Pairwise selection functions | Brief description |
ga_select_two_random() | Select entities at random |
ga_select_two_every() | Sequentially select each unique pair of entities |
ga_select_two_randomrank() | Select first entity at random where probability is a linear function of rank and second is sequentially selected |
ga_select_two_bestof2() | Select entities by pairwise tournament |
ga_select_two_roulette() | Select entities by stochastic, roulette-wheel, approach | |
ga_select_two_sus() | Select entities by Stochastic Universal Sampling | |
ga_select_two_aggressive() | Select first entity at random where probability is an exponential function of rank and second entity at random | |
ga_select_two_best() | Always select the single fittest entity | |
Custom selection operators
In addition to the built-in selection operators, custom operators may be readily used. This is not documented at present because it is considered to be advanced usage. Please email the GAUL mailing list if you would like some hints or instructions.
|