Interface HasPhase2D.Data2Phase

All Known Implementing Classes:
ATBT.ATBTMap, EcoPGG.EcoPGGMap, ParaGraph.TraitMap
Enclosing interface:
HasPhase2D

public static interface HasPhase2D.Data2Phase
Interface for providing custom mappings from data to 2D phase plane projections.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    data2Phase(double[] data, Point2D point)
    Convert data array to point on phase plane.
    default double
    getMaxX(RingBuffer<double[]> buffer)
    Return maximum value for x-axis.
    default double
    getMaxY(RingBuffer<double[]> buffer)
    Return maximum value for y-axis.
    default double
    getMinX(RingBuffer<double[]> buffer)
    Return minimum value for x-axis.
    default double
    getMinY(RingBuffer<double[]> buffer)
    Return minimum value for y-axis.
    default int[]
    Get the array of indices of traits displayed on the horizontal axis of the phase plane.
    default int[]
    Get the array of indices of traits displayed on the vertical axis of the phase plane.
    default String
    Return custom label for x-axis
    default String
    Return custom label for y-axis
    default boolean
    Return whether axis of the phase plane are customizable.
    default boolean
    Return whether multiple traits can be selected for each axis of the phase plane.
    default boolean
    Modules may probe whether setTraits is implemented.
    boolean
    phase2Data(Point2D point, double[] data)
    Convert point on phase plane to data array.
    default void
    Reset the map.
    default void
    setTraits(int[] x, int[] y)
    Allows custom implementations to set the traits displayed on phase plane axis.
  • Method Details

    • data2Phase

      boolean data2Phase(double[] data, Point2D point)
      Convert data array to point on phase plane. Note: data includes time at node[0] and should not be altered. Point on phase plane is returned in user coordinates.
      Parameters:
      data - array of data to convert
      point - on phase plane
      Returns:
      true upon successful completion of conversion
    • phase2Data

      boolean phase2Data(Point2D point, double[] data)
      Convert point on phase plane to data array. data contains a copy of the last data point recorded in the buffer (excluding time).
      Parameters:
      point - on phase plane to convert (in user coordinates)
      data - array of data
      Returns:
      true upon successful completion of conversion
    • reset

      default void reset()
      Reset the map. For maps that implement automatic scaling of the axes this should reset the range of the phase plane.
    • getXAxisLabel

      default String getXAxisLabel()
      Return custom label for x-axis
      Returns:
      x-axis label
    • getYAxisLabel

      default String getYAxisLabel()
      Return custom label for y-axis
      Returns:
      y-axis label
    • getMinX

      default double getMinX(RingBuffer<double[]> buffer)
      Return minimum value for x-axis. Returns 0 by default.
      Parameters:
      buffer - the buffer with data points
      Returns:
      the lower bound for x-axis
    • getMaxX

      default double getMaxX(RingBuffer<double[]> buffer)
      Return maximum value for x-axis. Returns 1 by default.
      Parameters:
      buffer - the buffer with data points
      Returns:
      upper bound for x-axis
    • getMinY

      default double getMinY(RingBuffer<double[]> buffer)
      Return minimum value for y-axis. Returns 0 by default.
      Parameters:
      buffer - the buffer with data points
      Returns:
      the lower bound for y-axis
    • getMaxY

      default double getMaxY(RingBuffer<double[]> buffer)
      Return maximum value for y-axis. Returns 1 by default.
      Parameters:
      buffer - the buffer with data points
      Returns:
      the upper bound for y-axis
    • hasSetTraits

      default boolean hasSetTraits()
      Modules may probe whether setTraits is implemented. If the method returns true the --phase2daxis command line option is available otherwise not (e.g. when using custom maps such as in module ATBT).
      Returns:
      true if displayed traits can be customized
    • setTraits

      default void setTraits(int[] x, int[] y)
      Allows custom implementations to set the traits displayed on phase plane axis.

      In multi-species models the traits are numbered sequentially, i.e. if the first species has nTraits then e.g. an index of nTraits+1 refers to the second trait of the second species. Be careful to account for vacant types in density based models.

      Parameters:
      x - the array of indices of horizontal trait(s)
      y - the array of indices of vertical trait(s)
    • getTraitsX

      default int[] getTraitsX()
      Get the array of indices of traits displayed on the horizontal axis of the phase plane.
      Returns:
      the array of indices
    • getTraitsY

      default int[] getTraitsY()
      Get the array of indices of traits displayed on the vertical axis of the phase plane.
      Returns:
      the array of indices
    • hasMultitrait

      default boolean hasMultitrait()
      Return whether multiple traits can be selected for each axis of the phase plane.
      Returns:
      true if multiple traits can be selected for each axis
      See Also:
    • hasFixedAxis

      default boolean hasFixedAxis()
      Return whether axis of the phase plane are customizable.
      Returns:
      true if axis can be customized
      See Also: