Main.Tutorials
Class Tutorial5
java.lang.Object
Main.State
Main.AbstractRun
Main.Tutorials.Tutorial5
- All Implemented Interfaces:
- java.io.Serializable
public class Tutorial5
- extends AbstractRun
Tutorial5 main class.
In Tutorial4 we had a look at a simple algorithm that only
initilised a population. In this tutorial we will show how to
construct a simple algorithm.
In GEVA algorithms are built by combining different modules into a
pipeline. A module is a self-contained algorithm building block, by
stacking modules an algorithm is created (You could create your
entire algorithm in one module, but that is not what GEVA is
designed for.) Another tutorial will deal with creating your own
modules, this tutorial only deals with the existing GEVA modules.
A module should perform a single part of the algorithm, e.g
mutation or selection. In this tutorial we will create a fairly
standard evolutionary algorithm using tournament selection,
int-flip mutation and single point crossover, the newly created
individuals will replace the worst individuals in the population.
This class is derived from the class State. State is conceptually
the outer level of a program created using GEVA, it is a container
class for the algorithm and it used to setup initialise and run the
algorithm. AbstractRun provides parameter reading
functionality. You should try to familiarise yourself with GEVA's
parameterisation mechanism(Covered in a later tutorial) as it will
make your life much easier :)
When Implementing a algorithm with GEVA it makes sense to extend
AbstractRun, and implement the method setup(String[] args).
- Author:
- erikhemberg
- See Also:
- Serialized Form
Constructor Summary |
Tutorial5()
Creates a new instance of Tutorial5 |
Method Summary |
void |
experiment(java.lang.String[] args)
|
static void |
main(java.lang.String[] args)
Run the state |
void |
setup()
|
void |
setup(java.lang.String[] args)
Setup the algorithm. |
Methods inherited from class Main.AbstractRun |
commandLineArgs, foundOptimum, getBestIndiv, getCollector, getCrossoverOperation, getFitnessFunction, getGEGrammar, getInitialiser, getJoinOperator, getMutationOperation, getSelectionOperation, init, printStuff, readProperties, run, setOutput |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Tutorial5
public Tutorial5()
- Creates a new instance of Tutorial5
setup
public void setup()
experiment
public void experiment(java.lang.String[] args)
- Specified by:
experiment
in class State
setup
public void setup(java.lang.String[] args)
- Setup the algorithm. Read the properties. Create the modules(Operators) and operations
- Specified by:
setup
in class AbstractRun
- Parameters:
args
- The command line arguments
main
public static void main(java.lang.String[] args)
- Run the state
- Parameters:
args
- The command line arguments