eaLib API Docs
Last Modified : January 7 2002

mss.ea.al
Class AbstractAlgorithm

java.lang.Object
  |
  +--mss.ea.al.AbstractAlgorithm
Direct Known Subclasses:
DelayExample, ListMutationExample, MergeExample, Salesman, Sphere

public abstract class AbstractAlgorithm
extends java.lang.Object

Abstract base class for a multithreaded evolutionary algorithm.

Since:
0.2
Version:
$Revision: 1.4 $ $Date: 2001/12/20 14:44:54 $
Author:
Andreas Rummler

Field Summary
protected  MessageBroker broker
          Message broker for passing messages to operators.
protected  AlgorithmChecker checker
          Algrithm component checker.
protected  ResultExtractor extractor
          Result extractor.
protected  FlowElementFactory factory
          Factory for creating flow elements from genetic operators.
protected  Timer timer
          Timer for measuring the run time of the algorithm.
 
Constructor Summary
AbstractAlgorithm()
          Constructor.
 
Method Summary
protected  void connect(FlowElement from, FlowElement to)
          Connects two flow elements.
protected  void connect(FlowElement from, int outputSlot, FlowElement to, int inputSlot)
          Connects two flow elements.
protected  void connect(GeneticOperator from, GeneticOperator to)
          Connects two genetic operators.
protected  void connect(GeneticOperator from, GeneticOperator to, int inputSlot)
          Connects two genetic operators.
protected  void connect(GeneticOperator from, int outputSlot, GeneticOperator to)
          Connects two genetic operators.
protected  void connect(GeneticOperator from, int outputSlot, GeneticOperator to, int inputSlot)
          Connects two genetic operators.
 void info()
          Prints some information about the algorithm structure.
protected  void result()
          Prints the results of the algorithm.
 void run()
          Runs the algorithm.
protected abstract  void setup()
          Method to perform the setup stage of the algorithm.
 void start(AbstractAlgorithm algorithm, java.lang.String[] args)
          Main method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checker

protected AlgorithmChecker checker
Algrithm component checker.

broker

protected MessageBroker broker
Message broker for passing messages to operators.

factory

protected FlowElementFactory factory
Factory for creating flow elements from genetic operators.

extractor

protected ResultExtractor extractor
Result extractor.

timer

protected Timer timer
Timer for measuring the run time of the algorithm.
Constructor Detail

AbstractAlgorithm

public AbstractAlgorithm()
Constructor.
Method Detail

connect

protected void connect(GeneticOperator from,
                       GeneticOperator to)
Connects two genetic operators. The connection is constructed from the output of the first element to the input of the second one. In case the elements contain more than one in- or output, the slot with the number 0 is assumed.
Parameters:
from - first operator
to - second operator

connect

protected void connect(GeneticOperator from,
                       GeneticOperator to,
                       int inputSlot)
Connects two genetic operators. The connection is constructed from the output of the first element to the given input slot of the second one. In case the "from" element contain more than one output, the slot with the number 0 is assumed.
Parameters:
from - first operator
to - second operator
inputSlot - slot of second operator

connect

protected void connect(GeneticOperator from,
                       int outputSlot,
                       GeneticOperator to)
Connects two genetic operators. The connection is constructed from the given output slot of the first element to the second one.
Parameters:
from - from operator
output - slot of first operator
to - second operator

connect

protected void connect(GeneticOperator from,
                       int outputSlot,
                       GeneticOperator to,
                       int inputSlot)
Connects two genetic operators. The connection is constructed from the given output slot of the first element to the given input slot of the second one.
Parameters:
from - first operator
output - output slot of the first operator
to - second operator
input - input slot of the second operator

connect

protected void connect(FlowElement from,
                       FlowElement to)
Connects two flow elements. The connection is constructed from the given output slot of the first element to the given input slot of the second one.
Parameters:
from - first element
output - output slot of the first element
to - second element
input - input slot of the second element

connect

protected void connect(FlowElement from,
                       int outputSlot,
                       FlowElement to,
                       int inputSlot)
Connects two flow elements. The connection is constructed from the given output slot of the first element to the given input slot of the second one.
Parameters:
from - first element
output - output slot of the first element
to - second element
input - input slot of the second element

run

public void run()
Runs the algorithm.

setup

protected abstract void setup()
Method to perform the setup stage of the algorithm. This is called before running the algorithm. All initializations must be done in this method.

result

protected void result()
Prints the results of the algorithm. The default behaviour is printing the contents of the best individual to System.out.

info

public void info()
Prints some information about the algorithm structure.

start

public void start(AbstractAlgorithm algorithm,
                  java.lang.String[] args)
           throws java.lang.Exception
Main method. This starts the algorithm.
Parameters:
algorithm - abstract algorithm object to run
args - command line options

eaLib API Docs
Last Modified : January 7 2002

Copyright © 2000-2001 Technical University of Ilmenau, Department ESS