|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rubecula.darwin.evolution.EvolutionTask
public class EvolutionTask
Lifespan: transient.
This class represents an evolutionary event involving the various
Evolvable
objects passed in through the constructor.
TODO consider extending AToString
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
EvolutionTask(Evolver evolver,
java.util.Map<Evolvable,java.lang.Integer> evolvables,
java.util.Collection<GenerationListener> listeners)
Secondary constructor for a new EvolutionTask (i.e. |
|
EvolutionTask(Evolver evolver,
java.util.Map<Evolvable,java.lang.Integer> evolvables,
java.util.Collection<GenerationListener> listeners,
long clock,
ClockWatcher clockWatcher)
Primary constructor for EvolutionTask. |
Method Summary | |
---|---|
long |
getClock()
|
java.util.Set<Evolvable> |
getEvolvableKeys()
|
boolean |
isPaused()
|
void |
run()
If not isPaused() , then invoke tick() . |
void |
setPaused(boolean paused)
|
protected boolean |
tick()
Invoke one tick of this EvolutionTask 's clock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
Constructor Detail |
---|
public EvolutionTask(Evolver evolver, java.util.Map<Evolvable,java.lang.Integer> evolvables, java.util.Collection<GenerationListener> listeners)
evolver
- XXXevolvables
- the map of evolvables/integerslisteners
- the set of listeners
TESTpublic EvolutionTask(Evolver evolver, java.util.Map<Evolvable,java.lang.Integer> evolvables, java.util.Collection<GenerationListener> listeners, long clock, ClockWatcher clockWatcher)
evolver
- XXXevolvables
- the map of evolvables/integerslisteners
- the set of listenersclock
- the initial value of clock (normally 0 for a new task).clockWatcher
- XXXMethod Detail |
---|
public long getClock()
getClock
in interface Clocked
Clocked.getClock()
public java.util.Set<Evolvable> getEvolvableKeys()
Evolvable
objects.public boolean isPaused()
paused
state.public void run()
isPaused()
, then invoke tick()
.
run
in interface java.lang.Runnable
Runnable.run()
public void setPaused(boolean paused)
paused
- protected boolean tick() throws EvolutionException
EvolutionTask
's clock.
EvolutionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |