Class Predator

All Implemented Interfaces:
Runnable, MilestoneListener, Model.HasDE, 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.
    • cloPredator

      public final CLOption cloPredator
      Command line option to set the predator parameters.
  • 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

    • 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)
    • collectCLO

      public void collectCLO(CLOParser parser)
      Description copied from interface: CLOProvider
      All providers of command line options must implement this method to collect their options.

      Each command line option is (uniquely) identified by it's name (see CLOption.getName()), which corresponds to the long version of the option. If an attempt is made to add an option with a name that already exists, the parser issues a warning and ignores the option. Thus, in general, implementing subclasses should first register their options and call super.collectCLO(CLOParser) at the end such that subclasses are able to override command line options specified in a parental class.

      Override this method in subclasses to add further command line options. Subclasses must make sure that they include a call to super.

      Specified by:
      collectCLO in interface CLOProvider
      Overrides:
      collectCLO in class Discrete
      Parameters:
      parser - the reference to parser that manages command line options
      See Also:
    • createIBSPop

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