genotype
integer |
selected genotype index of the currently selected genotype or -1 if no genotype is selected |
group
integer |
selected group index of the currently selected group (gene pool) |
size
integer |
Number of groups |
addGroup
doesn't return a value |
function addGroup(string name)add genotype group |
addPerformanceFromCreature
doesn't return a value |
function addPerformanceFromCreature()Updates the current Genotype's performance values merging them with the current Creture's performance. It assumes the Genotype.popsiz has a reasonable value and performs the proper weighting. Use your own function instead if these conditions are not met in your experiment. |
clear
doesn't return a value |
function clear()remove all groups except the first one |
clearGroup
doesn't return a value |
function clearGroup(integer index) |
copySelected
doesn't return a value |
function copySelected(integer groupindex)copy selected genotype to another group |
crossoverSelected
doesn't return a value |
function crossoverSelected(integer other_index)Crossover selected genotype with another one (from the genotype group). The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected. |
deleteGroup
doesn't return a value |
function deleteGroup(integer index)remove genotype group |
deleteOne
doesn't return a value |
function deleteOne(integer genotype_index)delete one individual from the gene pool = decrease popsiz and delete the genotype if the popsiz goes to 0 |
deleteSelected
doesn't return a value |
function deleteSelected()delete selected genotype from the gene pool (uses the selected genotype object) |
findGenotype
returns integer |
function findGenotype()find a genotype matching the current genotype. It only makes sense when the current genotype is a result of the genetic operator. |
findGenotypeForCreature
returns integer |
function findGenotypeForCreature()find a genotype matching the selected creature |
get
returns GenePool |
function get(integer index) |
getFromCreature
doesn't return a value |
function getFromCreature()Copy a genotype from the selected creature. The resulting genotype is stored in the static Genotype object detached from the genotype group. |
getFromCreatureObject
doesn't return a value |
function getFromCreatureObject(Creature)Copy a genotype from the creature object passed in argument. The resulting genotype is stored in the static Genotype object detached from the genotype group. |
likeThisRoulette
returns integer |
function likeThisRoulette(float minimum_similarity)get random genotype similar to the selected one, fitness proportional |
mutateSelected
doesn't return a value |
function mutateSelected()Mutate selected genotype. The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected. |
newGenotype
doesn't return a value |
function newGenotype(string genotype)Make the new genotype from the supplied string and select the genotype. The resulting genotype is stored in the static Genotype object detached from the genotype group. After calling this function GenePools.genotype is -1 indicating that no genotype from the group is selected. (call "copySelected" if you want to add this gentype to the genotype group) |
random
returns integer |
function random()get random genotype |
randomLikeThis
returns integer |
function randomLikeThis(float minimum_similarity)get random genotype similar to the selected one |
revroulette
returns integer |
function revroulette()get reverse fitness proportional genotype |
roulette
returns integer |
function roulette()get fitness proportional genotype |
tournament
returns integer |
function tournament(integer genotypes_in_tournament)get tournament winner genotype |
worst
returns integer |
function worst()get worst genotype |
| Global context |