Class Predator

All Implemented Interfaces:
Runnable, LifecycleListener, Model.HasDE, RunListener, Features, Features.Multispecies, CLOProvider

class Predator extends Discrete implements Features.Multispecies, Model.HasDE
Predator class representing the predator species in the Lotka-Volterra model.
  • Field Details

    • PREDATOR

      static final int PREDATOR
      The index of the predator.
      See Also:
    • prey

      LV prey
      The reference to the prey species.
    • rates

      double[] rates
      The reaction rates for predator reproduction, predation, and competition.
  • Constructor Details

    • Predator

      public Predator(LV prey)
      Create a new instance of the phage population.
      Parameters:
      prey - the reference to the prey species
  • Method Details

    • load

      public void load()
      Description copied from class: Module
      Load new module and perform basic initializations.
      Overrides:
      load in class Discrete
      See Also:
    • getDependent

      public int getDependent()
      Description copied from interface: Model.HasDE
      For replicator dynamics the frequencies of all traits must sum up to one. Hence, for nTraits traits there are only nTraits-1 degrees of freedom. The index returned by getDependent() marks the one rate of change that is derived from all the others.

      Notes:

      • Dependent traits are used by models where the frequencies of all types must sum up to one.
      • Density modules do not have dependent traits and getDependent() should return -1.
      • Currently differential equations implementations are only provided for Discrete modules.
      Specified by:
      getDependent in interface Model.HasDE
      Returns:
      the index of the dependent trait (or -1 if there is none)
    • createIBSPopulation

      public IBSPop createIBSPopulation()
      Description copied from class: Module
      Opportunity to supply custom individual based simulations.
      Overrides:
      createIBSPopulation in class Module<Discrete>
      Returns:
      the custom IBSPopulation or null to use default.