Package net.lukemcomber.genetics
Class Ecosystem
java.lang.Object
net.lukemcomber.genetics.Ecosystem
- Direct Known Subclasses:
EpochEcosystem
,MultiEpochEcosystem
,SteppableEcosystem
The ecosystem the simulation will run in. An ecosystem comprises Terrain, Organisms, and Resources
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MetadataStoreGroup
protected final UniverseConstants
-
Constructor Summary
ConstructorsConstructorDescriptionEcosystem
(int ticksPerDay, SpatialCoordinates size, UniverseConstants universe) Ecosystem
(int ticksPerDay, SpatialCoordinates size, UniverseConstants universe, String name) -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.getId()
Get the ecosystems unique idGet the list of organisms that seeded the ecosystemprotected AtomicBoolean
protected AtomicBoolean
protected AtomicBoolean
getName()
Get simulation nameGet the simulation's configuration propertyabstract EcosystemDetails
Get the ecosystem configuration used to build this ecosystemGet the terrainint
Get the count of ticks in a daygetTime()
long
Deprecated.long
Deprecated.abstract void
initialize
(Callable<Void> cleanUpHook) Initializes the ecosystemboolean
isActive()
Is the simulation activevoid
isActive
(boolean active) Set if the ecosystem is activevoid
setCurrentTick
(int currentTick) Deprecated.void
setTotalDays
(long totalDays) Deprecated.void
setTotalTicks
(long totalTicks) Deprecated.protected void
Advance the environment by one tickprotected void
Advance all organisms by one tick
-
Field Details
-
properties
-
metadataStoreGroup
-
-
Constructor Details
-
Ecosystem
public Ecosystem(int ticksPerDay, SpatialCoordinates size, UniverseConstants universe) throws IOException - Throws:
IOException
-
Ecosystem
public Ecosystem(int ticksPerDay, SpatialCoordinates size, UniverseConstants universe, String name) throws IOException - Throws:
IOException
-
-
Method Details
-
getTime
-
getIsRunning
-
getIsInitialized
-
getIsCleanedUp
-
getTotalTicks
Deprecated.Gets the total ticks of the simulation- Returns:
- ticks
-
setTotalTicks
Deprecated.Sets the total ticks- Parameters:
totalTicks
-
-
getTotalDays
Deprecated.Get total days- Returns:
- total days
-
setTotalDays
Deprecated.Sets the total days- Parameters:
totalDays
-
-
getTerrain
Get the terrain- Returns:
- terrain
-
getCurrentTick
Deprecated.Get the current tick- Returns:
- current tick
-
setCurrentTick
Deprecated.Sets the current tick- Parameters:
currentTick
-
-
getName
Get simulation name- Returns:
- name
-
getProperties
Get the simulation's configuration property- Returns:
- properties
-
initialize
Initializes the ecosystem -
getId
Get the ecosystems unique id- Returns:
-
getTicksPerDay
public int getTicksPerDay()Get the count of ticks in a day- Returns:
- ticks in a day
-
getInitialPopulation
Get the list of organisms that seeded the ecosystem- Returns:
- list of genome strings
-
isActive
public boolean isActive()Is the simulation active- Returns:
- true if currently running
-
isActive
public void isActive(boolean active) Set if the ecosystem is active- Parameters:
active
-
-
getWorldSize
-
getSetupConfiguration
Get the ecosystem configuration used to build this ecosystem- Returns:
- ecosystem configuration
-
tickEnvironment
protected void tickEnvironment()Advance the environment by one tick -
tickOrganisms
protected void tickOrganisms()Advance all organisms by one tick
-