|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Evolution
This interface defines the concept of an Evolution. This concept is central to the Darwin framework and forms part of a triad of fundamental concepts:
The properties of an Evolution are as follows:Evolvable
evolvables and their generation frequencies
(in ticks of the clock);GenerationListener
s -- after each tick, any
evolver which has undergone a new generation will be passed to this listener;
start
, pause
,
resume
, stop
)next
)isActive(boolean)
;Runnable
event at a future
time;Theological.seedMembers()
methods (this is really just a convenience
method).
Note that in general, there will be two modes of updating the user interface,
during evolution. The generation listeners fire at the completion of each
generation. If you also want to visualize updates at more points during the
completion of a generation, then you should also set up
VisualizableListener
s on an Visualizable
objects (such as
Population
s or Environment
s).
Method Summary | |
---|---|
boolean |
isActive(boolean ignoreEvents)
|
boolean |
isPaused()
|
void |
pause()
suppress all new generations until resume() is called. |
void |
resume()
cancel the previous call of pause() . |
java.util.concurrent.Future<?> |
scheduleEvent(long millisecs,
java.lang.Runnable event)
Schedule an arbitrary event for execution after a specific number of milliseconds. |
boolean |
shutdown()
A terminal shut-down of the Evolution process (including both evolution and scheduled events). |
boolean |
stop()
|
boolean |
stoppable()
|
boolean |
waitUntilComplete(int delay)
Wait for this Evolution to become inactive, then return. |
Methods inherited from interface com.rubecula.darwin.evolution.Evolver |
---|
addEvolvable, addEvolvable, addListener, cleanup, getClockWatcher, getEvolvableKeys, init, next, removeEvolvable, seedEvolvables, setClockWatcher |
Methods inherited from interface com.rubecula.darwin.foundation.Clocked |
---|
getClock |
Methods inherited from interface java.lang.Runnable |
---|
run |
Method Detail |
---|
boolean isActive(boolean ignoreEvents) throws EvolutionException
ignoreEvents
- XXX
EvolutionException
boolean isPaused()
EvolutionTask.isPaused()
returns true for the
evolution task.
XXX is this OK? what if evolutionTask is null?EvolutionTask.isPaused()
void pause() throws EvolutionException
resume()
is called.
EvolutionException
void resume() throws EvolutionException
pause()
.
EvolutionException
java.util.concurrent.Future<?> scheduleEvent(long millisecs, java.lang.Runnable event)
millisecs
- the number of millisecs before the event is to be run.event
- the event to be run.
Future
for this event, returned by the schedulerboolean shutdown() throws EvolutionException
pause()
and stop()
.
ExecutorService.awaitTermination(long, TimeUnit)
which, roughly speaking, will be true if everything shut down in
an orderly fashion.
EvolutionException
stop()
boolean stop() throws EvolutionException
EvolutionException
boolean stoppable()
Evolution
.boolean waitUntilComplete(int delay) throws EvolutionException
Evolution
to become inactive, then return.
delay
- delay between tests (in milliseconds)
EvolutionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |