Package org.evoludo.simulator.views
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 TypeMethodDescriptionboolean
data2Phase
(double[] data, Point2D point) Convert data array to point on phase plane.default double
getMaxX
(RingBuffer<double[]> buffer) Return maximum value forx
-axis.default double
getMaxY
(RingBuffer<double[]> buffer) Return maximum value fory
-axis.default double
getMinX
(RingBuffer<double[]> buffer) Return minimum value forx
-axis.default double
getMinY
(RingBuffer<double[]> buffer) Return minimum value fory
-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 forx
-axisdefault String
Return custom label fory
-axisdefault 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 whethersetTraits
is implemented.boolean
phase2Data
(Point2D point, double[] data) Convert point on phase plane to data array.default void
reset()
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
Convert data array to point on phase plane. Note:data
includes time atnode[0]
and should not be altered. Point on phase plane is returned in user coordinates.- Parameters:
data
- array of data to convertpoint
- on phase plane- Returns:
true
upon successful completion of conversion
-
phase2Data
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
Return custom label forx
-axis- Returns:
x
-axis label
-
getYAxisLabel
Return custom label fory
-axis- Returns:
y
-axis label
-
getMinX
Return minimum value forx
-axis. Returns0
by default.- Parameters:
buffer
- the buffer with data points- Returns:
- the lower bound for
x
-axis
-
getMaxX
Return maximum value forx
-axis. Returns1
by default.- Parameters:
buffer
- the buffer with data points- Returns:
- upper bound for
x
-axis
-
getMinY
Return minimum value fory
-axis. Returns0
by default.- Parameters:
buffer
- the buffer with data points- Returns:
- the lower bound for
y
-axis
-
getMaxY
Return maximum value fory
-axis. Returns1
by default.- Parameters:
buffer
- the buffer with data points- Returns:
- the upper bound for
y
-axis
-
hasSetTraits
default boolean hasSetTraits()Modules may probe whethersetTraits
is implemented. If the method returnstrue
the--phase2daxis
command line option is available otherwise not (e.g. when using custom maps such as in moduleATBT
).- 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 ofnTraits+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:
-