Interface for Algorithms
This simple interface defines three methods that an algorithm must implement
init() - runs the initialisation pipline(s) of the algorithm.
This class is used for building a genotype to phenotype mapping
it also stores information on which codons affect structural or
nodal grammar rules, for a more selective mutation
Build a file list of all the files in the specified directories matching
the specified wildcard. pathList can contain several paths separated by
a semi-colon (;) e.g.
Given a derivation tree and a codon index, return the tree node that
makes use of the codon at that index. e.g., if codonIndex was 0, the
root branch decides which production is picked based on the value of the
codon at index 0, so the root is returned in this case
Get the index of the codon used to choose the child (production) of this
tree node. -1 is returned if no codon was used (e.g., if production was
choosen because it was the only one to pick)
Extract range for value from non-terminal specification,
where specification is in the format (set-mode)
or (range-mode -- range can be open, closed, or half-open).
This method calculates an upper bound for the number of inputs
needed to build a derivation tree according to the specified
maxDerivationTreeDepth and the max number of non terminals in a
production of the grammars rules.
Create a new state at position (0, 0) and at angle 270 degrees, or
pointing vertically up, in screen co-ordinates, i.e. calling move
would move up the screen
When showing error messages in classes that don't have direct access to
a parent window, this allows them to set the parent to be the
application window.
Given two individuals, whoses chromosomes are split into three codon
groups running from [0..point1), [point1..point1+length), and
[point1+length..usedGenes), named head, body, and tail respectively,
return a chromosome with a head and tail made up of individual-one's
chromosome, and individual-two's body, i.e., head(i1)+body(i2)+tail(i1).
Given two individuals, whose chromosomes are split into three
codon groups running from [0..point1),
[point1..point1+length), and [point1+length..usedGenes), named
head, body, and tail respectively, return a chromosome with a
head and tail made up of individual-one's chromosome, and all
of individual-two, i.e., head(i1)+all(i2)+tail(i1).
MersenneTwister and MersenneTwisterFast
Version 13, based on version MT199937(99/10/29)
of the Mersenne Twister algorithm found at
The Mersenne Twister Home Page, with the initialization
improved using the new 2002/1/26 initialization algorithm
By Sean Luke, October 2004.
The population is divided(ramped) between minimum depth(shortest possible depth of a derivationTree)
and maximum depth(Maximum allowed depth of a derivationTree).
Trim an array of strings so that all white-space padding is removed and
any strings that contained just white-space and removed completely from
the array. e.g. {" a ", " ", "b"} -> {"a", "b"}
Scaled Roulette wheel selection based on weighted selection,
The likelyhood of an individual getting picked is:
total sum of the fitness - fitness of the individual
Specifies the range to test the fitness for symbolic regression.The format
is sr_range= x eq [start; stepSize; stop]; and multiple ranges can be
specified eg sr_range = x0 eq [0:.5:2]; x1 eq [2:.1:5].
For a fixed range input string as x eq [start:step:stop];
e.g inputs 0,0.1,0.2,...,1 for x0 and x1 is x0 eq [0:0.1:1]; x1 eq [0:0.1:1]
For random numbers from a range or x eq rnd(start, cases ,stop);
e.g random inputs rom range 0 to 1 for x0 and x1 is x0 eq rnd(0,10,1); x1 eq rnd(0,10,1)
Pick a single point to mutate, but having mutated, remove all the codons that
used to define the old branch, and then follow the new branch, randomly
generating values to pick productions, until a complete branch is built
or the maximum depth is reached.