The probability that each node in the genome-tree will be subjected to mutation (see mutate()).
If non-zero, then a fixed number of mutations (equal to FixedMutations) will be attempted, regardless of genome size. This attribute overrides any setting of NodeMutationProb.
The probability with which FixedMutations will be performed. A setting of 0.1 would mean that 10% of the offspring from crossover are mutated.
A mutation is either a point mutation or a macro mutation, this attribute controls how much of either. A setting of 1 means all point mutation and 0 means all macro mutation.
With this probability, point mutations on numbers (satisfying NumericMutationRegex) will be altered instead of replaced.
qr/^[+-]?\d+(?:\.\d+)?([eE][+-]?\d+)?$/
Numeric mutations will only be done if this pattern matches the terminal node contents.
Define the keys in this hash as the nodetypes you don't want to be numerically mutated, for example:
NumericAllowNTypes => { ANGLE => 1, INDEX => 1 },
By default, all other terminals which match NumericMutationRegex will be mutated, with the default change factor of 0.1 (see NumericAllowNTypes).
Define the keys in this hash as the nodetypes you want to be numerically mutated, for example:
NumericAllowNTypes => { NUM => 1, CONST => 2 },
Where the values indicate how much change occurs on mutation. The change is calculated as:
if (rand(1)<0.5) { $num *= (1 + $changefactor); } else { $num /= (1 + $changefactor); }
where $changefactor
is the value given in your hash.
If true, mutations will be repeated until a visible change in the program code is observed. This involves tree expansion and is therefore not very efficient. Effects not properly benchmarked.
Depth bias for point mutation node sampling. See _random_node() for details. The default of 0 means no bias at all (and so terminal nodes are relatively likely).
Depth bias for macro mutation node sampling. See _random_node() for details.
This array contains the names of the macro mutation operators which may be used. An example of a name is swap_subtrees (do not include the () which is used in this manual for purposes of clarity only). Choice of operator is done in macro_mutate() by random sampling, so if you want to bias a certain operator, include its name in this array more than once.
The default array contains a single copy each of: swap_subtrees copy_subtree replace_subtree insert_internal delete_internal
Note that encapsulate_subtree and point_mutate_deep are not included by default.
Don't allow these nodetypes (the keys in the hash) to be encapsulated. The values are not used. Example definition:
EncapsulateIgnoreNTypes => { ADF => 1 },
During node sampling in encapsulate_subtree(), subtrees are skipped if they contain more than EncapsulateFracMax of the total nodes in the tree. This is intended to prevent too much of a program being encapsulated. Not benchmarked!
The probability that an already encapsulated subtree will be used instead of a function, during new subtree growth. Not benchmarked!
The filename for the mutation log. Relative to the experiment directory.
The probability with which a log entry is written to MutationLogFile.
The per node crossover point selection probability.
If non-zero, then a fixed number of crossover points (equal to FixedXovers) will be attempted, regardless of genome size. This attribute overrides any setting of NodeXoverProb.
The probability with which FixedXovers crossover points will be attempted during reproduction (otherwise no crossovers will be attempted, which is the same as asexual reproduction).
Depth bias for crossover point sampling. See _random_node() for details. If the depth wasn't biased, then too often crossovers would take place between ``uninteresting'' leaf nodes and small subtrees.
This controls the strictness of size-equal crossover point selection. By size-equal, I mean that crossover points are selected with a bias towards similar sized subtrees. Increase this (say to 2 or 4) and the algorithm described in crossover() spends longer looking for similar sized subtrees.
This controls the strictness of homologous subtree crossover point selection. Increase this value to 2 or 4, for example, to tell the algorithm described in crossover() to spend longer looking for crossover points with similar subtree contents.
If true, force all crossovers to use the root node, and hence make identical copies of both parents. All other crossover parameters are ignored.
The file (relative to the experiment directory) where some information about crossover point selection is logged.
The fraction of recombination events for which XoverLogFile is written to.
Controls the maximum allowable tree size. The way this works is counter-intuitive so pay attention... Trees are allowed to be bigger than this size limit, however when the genome tree is converted into code, only the first MaxTreeNodes are expanded properly into what the ``code for'', all subsequent nodes are expanded into a randomly picked terminal (see _expand_tree()). This probably gives an disfunctional program and so indirectly prevents tree growth beyond this size. Note that this is really just a safety limit, not a recommended way to control code growth. Don't forget about MaxTreeNodes though, one day you will probably need to raise it.
This attribute defines a minimum tree size (in nodes) for new trees only. If a brand new random tree (usually made during Population initialisation) has fewer than this number of nodes, then the tree is discarded and made again (and repeated until a big enough tree is generated). Currently this is implemented without a check for infinite looping, so watch out.
This attribute does not affect subtree generation.
A fixed limit on tree depth for brand new trees only. When a growing branch of a tree reaches this limit, only terminals are added (like in Koza's and other GP implementations). Note that this is different to the implementation of MaxTreeNodes.
The default is just a safety limit because it is assumed that you are using a ``naturally terminating grammar''.
You may force the choice of terminals during new tree and subtree generation by setting this probability. It only has an effect at tree depths below TreeDepthMin. Note the default is zero.
The minimum depth before tree growth is probabilistically terminated with TerminateTreeProb.
Many of the macro mutation operators need to make new subtrees. They call _grow_tree() with a specific tree depth maximum which is generated from a capped Poisson distribution with the mean parameter NewSubtreeDepthMean, and cap NewSubtreeDepthMax. The default setting is quite high and assumes that you have a ``naturally terminating grammar''.
A hard upper limit on the size of new subtrees (see NewSubtreeDepthMean).
The fraction or probability with which existing terminals (already in the genome tree) are used instead of the usual pool of terminals held in Terminals. Usually you will want to combine this with numeric mutation. See also point_mutate().
If you are using parsimony pressure in your fitness function, you might want getSize() to ignore the trees below certain nodetypes. In this case you can specify these nodetypes in this hash.
This is the file stem for the DBM file where the genome tree is stored. It is a required attribute. See the program perlgp-rand-prog.pl to see how you can make a random program using a temporary DBFileStem.
This is the name of the current experiment directory (not the full path).
Each Individual knows to which Population it belongs. Currently this is not actually used anywhere. Since it is compulsory, you have to proivide a dummy value in applications such as perlgp-rand-prog.pl, sorry about that - I guess this will change.
\%Grammar::F
This is where the non-terminal grammar definitions are stored. In the
hash, keys are nodetypes and the values are anonymous arrays
containing different function options. More details of the format
used can be found in Section 7. Usually this hash is
shared between all Individual objects (otherwise memory usage would be
heavy), hence the default is a reference to the hash
%Grammar::F
.
You could customise the Individual class to dynamically alter Functions and Terminals if you wanted to.
\%Grammar::T
The terminal node options are stored here, see the entry for Functions, and also Section 7.