gpalta.gui
Class EvolutionThread

java.lang.Object
  extended by java.lang.Thread
      extended by gpalta.gui.EvolutionThread
All Implemented Interfaces:
java.lang.Runnable

public class EvolutionThread
extends java.lang.Thread

Controls the evolution in a thread separated from the gui


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EvolutionThread(GPaltaGUI gui, boolean fromFile)
          Creates a new instance of EvolutionThread
 
Method Summary
 void exit()
           
 void go(int n)
          Tell the Evolution to advance n generatinos
 void run()
          Invoked in a threaded way by the start method
 void save()
          Save inmediatelly (not threaded)
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EvolutionThread

public EvolutionThread(GPaltaGUI gui,
                       boolean fromFile)
Creates a new instance of EvolutionThread

Parameters:
gui - The GPaltaGUI that controls this EvoThread
fromFile - Whether the Evolution should continue from a previously saved "evo.bin" file
Method Detail

go

public void go(int n)
Tell the Evolution to advance n generatinos

Parameters:
n - The number of generations to advance

exit

public void exit()

save

public void save()
          throws java.io.IOException
Save inmediatelly (not threaded)

Throws:
java.io.IOException

run

public void run()
Invoked in a threaded way by the start method

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread