Class SimulatedEvolutionModel
java.lang.Object
java.util.concurrent.ForkJoinTask<java.lang.Void>
org.woehlke.computer.kurzweil.tabs.simulatedevolution.SimulatedEvolutionModel
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.Future<java.lang.Void>,Startable,TabModel,SimulatedEvolution
public class SimulatedEvolutionModel extends java.util.concurrent.ForkJoinTask<java.lang.Void> implements TabModel, SimulatedEvolution
The World contains Water, Cells and Food.
It is the Data Model of the Simulation in a MVC Pattern.
- Author:
- Thomas Woehlke User: thomas Date: 04.02.2006 Time: 19:06:20
- See Also:
Cell,Simulated Evolution. Artificial Life Simulation of Bacteria Motion depending on DNA. 2006 - 2008 Thomas Woehlke. http://thomas-woehlke.de/p/simulated-evolution/, Serialized Form
-
Field Summary
Fields inherited from interface org.woehlke.computer.kurzweil.tabs.simulatedevolution.SimulatedEvolution
TAB_TYPE -
Constructor Summary
Constructors Constructor Description SimulatedEvolutionModel(SimulatedEvolutionContext appCtx) -
Method Summary
Modifier and Type Method Description booleancancel(boolean mayInterruptIfRunning)voiddecreaseFoodPerDay()protected booleanexec()One Step of Time in the World in which the Population of Bacteria Cell perform Life.java.util.List<Cell>getAllCells()java.lang.VoidgetRawResult()booleanhasFood(int x, int y)voidincreaseFoodPerDay()protected voidsetRawResult(java.lang.Void value)voidstart()voidstop()voidtoggleGardenOfEden()Methods inherited from class java.util.concurrent.ForkJoinTask
adapt, adapt, adapt, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollSubmission, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnforkMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.concurrent.Future
get, get, isCancelled, isDone
-
Constructor Details
-
SimulatedEvolutionModel
-
-
Method Details
-
hasFood
public boolean hasFood(int x, int y) -
toggleGardenOfEden
public void toggleGardenOfEden() -
start
public void start() -
stop
public void stop() -
getAllCells
-
increaseFoodPerDay
public void increaseFoodPerDay() -
decreaseFoodPerDay
public void decreaseFoodPerDay() -
cancel
public boolean cancel(boolean mayInterruptIfRunning)- Specified by:
cancelin interfacejava.util.concurrent.Future<java.lang.Void>- Overrides:
cancelin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-
getRawResult
public java.lang.Void getRawResult()- Specified by:
getRawResultin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-
setRawResult
protected void setRawResult(java.lang.Void value)- Specified by:
setRawResultin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-
exec
protected boolean exec()One Step of Time in the World in which the Population of Bacteria Cell perform Life. Every Cell moves, eats, dies of hunger, and it has sex. splitting into two children with changed DNA.- Specified by:
execin classjava.util.concurrent.ForkJoinTask<java.lang.Void>
-