Class IBSPop


class IBSPop extends IBSDPopulation
Individual based simulation implementation of the Lotka-Volterra model.
  • Field Details

    • predator

      IBSPop predator
      The reference to the predator population. If isPredator==true then predator==this.
    • prey

      IBSPop prey
      The reference to the prey population. If isPredator==false then prey==this.
    • isPredator

      final boolean isPredator
      The flag to indicate whether this is a predator population. Convenience variable.
    • rates

      double[] rates
      The reaction rates for the predator/prey population. Convenience variable.
    • deathRate

      double deathRate
      The per capita death rate for the predator/prey population. Convenience variable.
    • maxRate

      double maxRate
      The maximum rate at which events can occur. This is used to convert rates into transition probabilities.
  • Constructor Details

    • IBSPop

      protected IBSPop(EvoLudo engine, Discrete module)
      Create a new custom implementation for IBS simulations.
      Parameters:
      engine - the pacemaker for running the model
      module - the reference to the module implementing the model
  • Method Details

    • check

      public boolean check()
      Description copied from class: IBSPopulation
      Check all model parameters for consistency and adjust if necessary (and feasible). Returns true if adjustments require a reset. Free memory if possible and request a reset if new memory needs to be allocated.
      Overrides:
      check in class IBSDPopulation
      Returns:
      true if reset is required
      See Also:
    • getSpeciesUpdateRate

      public double getSpeciesUpdateRate()
      Description copied from class: IBSPopulation
      Gets the update rate of this species. Only used in multi-species modules. Determines the relative rate at which this species is picked as compared to others.
      Overrides:
      getSpeciesUpdateRate in class IBSPopulation
      Returns:
      the species update rate
      See Also:
    • updatePlayerEcologyAt

      protected int updatePlayerEcologyAt(int me)
      Individual based simulation implementation of the classical Lotka-Volterra model in finite and structured populations. For a focal individual three events are possible based on the occupancy of a randomly selected neighbouring site A of the peer species as well as one of the opponent species B :
      1. reproduction: occurs at rate rates[0] if A is empty;
      2. death: spontaneous death occurs at rate rates[0] and death due to competition with peers occurs at rate rates[2] if A is occupied;
      3. predation: prey gets eaten at rate rates[1] if B is occupied, while predators have a chance to reproduce, provided A is empty.
      The relative rates at which the two species are updated depends on the population size as well as the above rates. In well-mixed populations and in the limit of large populations the above updating rules recover the ODE model.
      Overrides:
      updatePlayerEcologyAt in class IBSDPopulation
      Parameters:
      me - the index of the focal site
      Returns:
      the number of elapsed realtime units
      See Also:
    • setInitialTraits

      public boolean setInitialTraits(double[] init)
      Description copied from class: IBSDPopulation
      Set the initial trait frequencies in the population. Switches the initialization type to IBSD.Init.Type.FREQUENCY.
      Overrides:
      setInitialTraits in class IBSDPopulation
      Parameters:
      init - the initial traits
      Returns:
      true if the initialization was successful