Main
Class Run
java.lang.Object
Main.State
Main.AbstractRun
Main.Run
- All Implemented Interfaces:
- java.io.Serializable
public class Run
- extends AbstractRun
Run main class.
Steps to setup the algorithm.
Create the operators you want to use eg: mutation, selection.
Create specific operations eg: Int flip mutation, Tournament Selection.
Add the operations to the operators
Set the population in each operator.
Add opertors to the init pipeline in the desired order of execution.
Add operators to the loop pipeline in the desired order of execution.
Create a main for the algorithm to run this needs to call init, setup and run(int number_of_iterations)
(or the step() method can be used in a loop)
- Author:
- erikhemberg
- See Also:
- Serialized Form
Constructor Summary |
Run()
Creates a new instance of Run |
Method Summary |
void |
experiment(java.lang.String[] args)
|
static void |
main(java.lang.String[] args)
Run |
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 |
Run
public Run()
- Creates a new instance of Run
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
- arguments
main
public static void main(java.lang.String[] args)
- Run
- Parameters:
args
- arguments