Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.engine
Class DefaultAlgorithmRunner

java.lang.Object
  extended byorg.evolvica.engine.DefaultAlgorithmRunner
All Implemented Interfaces:
IRunner, java.lang.Runnable

public class DefaultAlgorithmRunner
extends java.lang.Object
implements IRunner

Default implementation of an algorithm runner. This runner executes an algorithm inside a single thread.

Since:
0.4.0
Version:
$Revision: 1.8 $ $Date: 2004/05/26 11:58:22 $
Author:
Andreas Rummler

Field Summary
protected  java.util.LinkedList activeQueue
          Queue with active elements.
protected  IAlgorithm algorithm
          The algorithm to be executed.
protected  java.lang.Thread algorithmThread
          Algorithm thread.
protected  java.util.HashSet operatorSet
          Set containing the operators of the algorithm.
protected  java.util.HashSet sinkSet
          Set containing the sinks of the algorithm.
protected  java.util.HashSet sourceSet
          Set containing the sources of the algorithm.
 
Constructor Summary
DefaultAlgorithmRunner()
           
 
Method Summary
 void resume()
          Resumes a stopped algorithm.
 void run()
          Runs the algorithm.
protected  void setupActiveQueue()
          Sets up the queue.
 void start(IAlgorithm algorithm)
          Executes the given algorithm
 void stop()
          Stops the currently running algorithm.
protected  void traverseElements()
          Traverses active elements and activates them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

algorithm

protected IAlgorithm algorithm
The algorithm to be executed.


algorithmThread

protected java.lang.Thread algorithmThread
Algorithm thread.


sourceSet

protected java.util.HashSet sourceSet
Set containing the sources of the algorithm.


operatorSet

protected java.util.HashSet operatorSet
Set containing the operators of the algorithm.


sinkSet

protected java.util.HashSet sinkSet
Set containing the sinks of the algorithm.


activeQueue

protected java.util.LinkedList activeQueue
Queue with active elements.

Constructor Detail

DefaultAlgorithmRunner

public DefaultAlgorithmRunner()
Method Detail

run

public void run()
Runs the algorithm.

Specified by:
run in interface java.lang.Runnable

start

public void start(IAlgorithm algorithm)
Description copied from interface: IRunner
Executes the given algorithm

Specified by:
start in interface IRunner
Parameters:
algorithm - algorithm to be executed
See Also:
IRunner.start(org.evolvica.engine.IAlgorithm)

stop

public void stop()
Description copied from interface: IRunner
Stops the currently running algorithm.

Specified by:
stop in interface IRunner
See Also:
IRunner.stop()

resume

public void resume()
Description copied from interface: IRunner
Resumes a stopped algorithm.

Specified by:
resume in interface IRunner
See Also:
IRunner.resume()

setupActiveQueue

protected void setupActiveQueue()
Sets up the queue.


traverseElements

protected void traverseElements()
Traverses active elements and activates them.


Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems