com.vadeen.neat.gui.AutoEvolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neat-gui Show documentation
Show all versions of neat-gui Show documentation
GUI implemenation for com.vadeen.neat.
The newest version!
package com.vadeen.neat.gui;
import com.vadeen.neat.Neat;
import com.vadeen.neat.gui.listeners.EvolveListener;
public class AutoEvolver extends Thread {
private final Neat neat;
private EvolveListener evolveListener;
private volatile boolean running = true;
public AutoEvolver(Neat neat) {
this.neat = neat;
}
public void setEvolveListener(EvolveListener evolveListener) {
this.evolveListener = evolveListener;
}
@Override
public void run() {
while (running) {
neat.evolve();
if (evolveListener != null)
evolveListener.onEvolve();
}
}
public void halt() {
running = false;
}
}