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 TypeMethodDescriptionbooleandata2Phase(double[] data, Point2D point) Convert data array to point on phase plane.default doublegetMaxX(RingBuffer<double[]> buffer) Return maximum value forx-axis.default doublegetMaxY(RingBuffer<double[]> buffer) Return maximum value fory-axis.default doublegetMinX(RingBuffer<double[]> buffer) Return minimum value forx-axis.default doublegetMinY(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 StringReturn custom label forx-axisdefault StringReturn custom label fory-axisdefault booleanReturn whether axes of the phase plane are customizable.default booleanReturn whether multiple traits can be selected for each axis of the phase plane.default booleanModules may probe whethersetTraitsis implemented.booleanphase2Data(Point2D point, double[] data) Convert point on phase plane to data array.default voidreset()Reset the map.default voidsetFixedAxes(boolean hasFixedAxes) Set whether axes of the phase plane are customizable.default voidsetTraits(int[] x, int[] y) Allows custom implementations to set the traits displayed on phase plane axes.
-
Method Details
-
data2Phase
Convert data array to point on phase plane. Note:dataincludes 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:
trueupon successful completion of conversion
-
phase2Data
Convert point on phase plane to data array.datacontains 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:
trueupon 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. Returns0by default.- Parameters:
buffer- the buffer with data points- Returns:
- the lower bound for
x-axis
-
getMaxX
Return maximum value forx-axis. Returns1by default.- Parameters:
buffer- the buffer with data points- Returns:
- upper bound for
x-axis
-
getMinY
Return minimum value fory-axis. Returns0by default.- Parameters:
buffer- the buffer with data points- Returns:
- the lower bound for
y-axis
-
getMaxY
Return maximum value fory-axis. Returns1by default.- Parameters:
buffer- the buffer with data points- Returns:
- the upper bound for
y-axis
-
hasSetTraits
default boolean hasSetTraits()Modules may probe whethersetTraitsis implemented. If the method returnstruethe--phase2daxescommand line option is available otherwise not (e.g. when using custom maps such as in moduleATBT).- Returns:
trueif displayed traits can be customized
-
setTraits
default void setTraits(int[] x, int[] y) Allows custom implementations to set the traits displayed on phase plane axes.In multi-species models the traits are numbered sequentially, i.e. if the first species has
nTraitsthen e.g. an index ofnTraits+1refers 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:
trueif multiple traits can be selected for each axis- See Also:
-
hasFixedAxes
default boolean hasFixedAxes()Return whether axes of the phase plane are customizable.- Returns:
trueif axes can be customized- See Also:
-
setFixedAxes
default void setFixedAxes(boolean hasFixedAxes) Set whether axes of the phase plane are customizable. Optional implementation. Axes are fixed by default.- Parameters:
hasFixedAxes-trueif axes are fixed
-