Class Ecosystem

java.lang.Object
net.lukemcomber.genetics.Ecosystem
Direct Known Subclasses:
EpochEcosystem, MultiEpochEcosystem, SteppableEcosystem

public abstract class Ecosystem extends Object
The ecosystem the simulation will run in. An ecosystem comprises Terrain, Organisms, and Resources
  • Field Details

  • Constructor Details

  • Method Details

    • getTime

      public TemporalCoordinates getTime()
    • getIsRunning

      protected AtomicBoolean getIsRunning()
    • getIsInitialized

      protected AtomicBoolean getIsInitialized()
    • getIsCleanedUp

      protected AtomicBoolean getIsCleanedUp()
    • getTotalTicks

      @Deprecated public long getTotalTicks()
      Deprecated.
      Gets the total ticks of the simulation
      Returns:
      ticks
    • setTotalTicks

      @Deprecated public void setTotalTicks(long totalTicks)
      Deprecated.
      Sets the total ticks
      Parameters:
      totalTicks -
    • getTotalDays

      @Deprecated public long getTotalDays()
      Deprecated.
      Get total days
      Returns:
      total days
    • setTotalDays

      @Deprecated public void setTotalDays(long totalDays)
      Deprecated.
      Sets the total days
      Parameters:
      totalDays -
    • getTerrain

      public Terrain getTerrain()
      Get the terrain
      Returns:
      terrain
    • getCurrentTick

      @Deprecated public int getCurrentTick()
      Deprecated.
      Get the current tick
      Returns:
      current tick
    • setCurrentTick

      @Deprecated public void setCurrentTick(int currentTick)
      Deprecated.
      Sets the current tick
      Parameters:
      currentTick -
    • getName

      public String getName()
      Get simulation name
      Returns:
      name
    • getProperties

      public UniverseConstants getProperties()
      Get the simulation's configuration property
      Returns:
      properties
    • initialize

      public abstract void initialize(Callable<Void> cleanUpHook)
      Initializes the ecosystem
    • getId

      public String 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

      public List<String> 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

      public SpatialCoordinates getWorldSize()
    • getSetupConfiguration

      public abstract EcosystemDetails 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