Interface ODE.HasDE

All Known Subinterfaces:
ODE.HasODE, PDE.HasPDE, SDE.HasSDE
All Known Implementing Classes:
ATBT, CDL, CDLP, CDLPQ, DemesTBT, EcoPGG, Moran, RSP, simCDL, simCDLP, simCDLPQ, simMoran, simTBT, simTraits, TBT, Traits
Enclosing class:
ODE

public static interface ODE.HasDE
Methods that every Module must implement, which advertises numerical solutions based on differential equations.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    avgScores(double[] density, int n, double[] avgscores)
    Calculate the average payoff/score for the frequency of traits/strategies specified in the array density for interactions in groups of size n.
    default void
    avgScores(double[] density, int n, double[] avgscores, int skip)
    Calculate the average payoff/score for the frequency of traits/strategies specified in the array density for interactions in groups of size n in multi-species interactions.
    default int
    For replicator dynamics the frequencies of all strategies must sum up to one.
  • Method Details

    • getDependent

      default int getDependent()
      For replicator dynamics the frequencies of all strategies must sum up to one. Hence, for nTraits strategies there are only nTraits-1 degrees of freedom. dependentTrait marks the one that is derived from the others.
      Returns:
      the index of the dependent trait or -1 if there is none
    • avgScores

      default void avgScores(double[] density, int n, double[] avgscores)
      Calculate the average payoff/score for the frequency of traits/strategies specified in the array density for interactions in groups of size n. The average payoffs/scores for each of the nTraits traits/strategies must be stored and returned in the array avgscores.

      Note: needs to be thread safe for parallel processing of PDE's.

      IMPORTANT: one of

      should be implemented in modules that advertise the model types ODE, SDE or PDE.

      Alternatively, the method ODE.getDerivatives(double, double[], double[], double[]) may be overridden in a subclass of ODE, which may prevent calls to avgScores(...) altogether.

      Parameters:
      density - the frequency/density of each trait/strategy
      n - the size of interaction groups
      avgscores - the array for storing the average payoffs/scores for each strategic type
    • avgScores

      default void avgScores(double[] density, int n, double[] avgscores, int skip)
      Calculate the average payoff/score for the frequency of traits/strategies specified in the array density for interactions in groups of size n in multi-species interactions. The state of the current species starts at index skip and the average payoffs/scores for each of its nTraits traits/strategies must be stored and returned in the array avgscores starting at index skip.

      Note: needs to be thread safe for parallel processing of PDE's.

      IMPORTANT: one of

      should be implemented in modules that advertise the model types ODE, SDE or PDE.

      Alternatively, the method ODE.getDerivatives(double, double[], double[], double[]) may be overridden in a subclass of ODE, which may prevent calls to avgScores(...) altogether.

      Parameters:
      density - the frequency/density of each trait/strategy
      n - the size of interaction groups
      avgscores - the array for storing the average payoffs/scores for each strategic type
      skip - the entries to skip in arrays density and avgscores