Interface Discrete

All Known Implementing Classes:
Advection, ATBT.ODE, IBSD, LV.ODE, LV.SDE, ODE, PDE, RungeKutta, SDE, SIR.ODE, SIR.PDE, SIR.SDE

public interface Discrete
Common interface for all models with discrete sets of traits.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    getInitialTraits(double[] init)
    Collect and return initial trait values for all species.
    void
    getInitialTraits(int id, double[] init)
    Return initial trait values for species with ID id.
    default double
    getMonoScore(int id, int idx)
    Calculate and return the payoff/score of individuals in monomorphic populations with trait idx but also deals with payoff accounting (averaged versus accumulated).
    default boolean
    setInitialTraits(double[] init)
    Set initial traits in one or all species.
    default boolean
    setInitialTraits(int id, double[] init)
    Set initial trait values for species with ID id.
  • Method Details

    • getMonoScore

      default double getMonoScore(int id, int idx)
      Calculate and return the payoff/score of individuals in monomorphic populations with trait idx but also deals with payoff accounting (averaged versus accumulated).
      Parameters:
      id - the id of the population for multi-species models
      idx - the index of the trait
      Returns:
      payoff/score in monomorphic population with trait idx. Returns NaN if scores ill defined
      See Also:
    • setInitialTraits

      default boolean setInitialTraits(double[] init)
      Set initial traits in one or all species.

      NOTE: this is a convenience method for multi-species modules to set inital states efficiently for interactions with GUI.

      Parameters:
      init - the array with the initial trait values
      Returns:
      true if initial traits successfully set
    • getInitialTraits

      void getInitialTraits(double[] init)
      Collect and return initial trait values for all species.

      NOTE: this is a convenience method for multi-species modules to retrieve states efficiently for further processing or visualization.

      Parameters:
      init - the array for storing the initial trait values
    • setInitialTraits

      default boolean setInitialTraits(int id, double[] init)
      Set initial trait values for species with ID id.
      Parameters:
      id - the species identifier
      init - the array with the initial trait values
      Returns:
      true if initial traits successfully set
    • getInitialTraits

      void getInitialTraits(int id, double[] init)
      Return initial trait values for species with ID id.
      Parameters:
      id - the species identifier
      init - the array for storing the initial trait values