Package uk.ac.starlink.ttools.scheme
Class AttractorFamily
java.lang.Object
uk.ac.starlink.ttools.scheme.AttractorFamily
Defines an interface and some implementations for a family of
(potentially) strange attractors.
- Since:
- 21 Jul 2020
- Author:
- Mark Taylor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Defines an unbounded sequence of points, that may represent an attractor. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AttractorFamily
Clifford attractors; 2d, with four parameters.static final AttractorFamily
Henon attractors; 2d, with three parameters (quite boring).static final AttractorFamily
Rampe attractors; 3d, wit six parameters. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AttractorFamily
(String name, int ndim, int nparam, double maxAbsParam, double fillThresh) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateAttractor
(double[] params, double[] seed) Creates an attractor in this family by supplying numeric parameters.createAttractor
(Random rnd) Creates a random attractor in this family.abstract UnaryOperator<double[]>
createOperator
(double[] params) Returns the operator which produces the next ndim-element output point from the previous one.int
Returns the dimensionality of points in the sequence generated by attractors from this family.abstract String
Returns a URL on the WWW at which additional or background information about this attractor family may be found.abstract String[]
Returns a list of lines giving a textual representation of the iteration formula used to generate attractors.abstract double[][]
Returns a hard coded list of attractor parameter arrays that represent interesting members of this family.double
Returns a guideline value for the space filling factor which represents an interesting (strange) attractor from this family.double
The maximum absolute value recommended for each of the input values (which should therefore be in the range [-maxAbsParam,+maxAbsParam]).getName()
Returns the name of this family.int
Returns the number of parameters required to produce an attractor instance.static double
getSpaceFraction
(AttractorFamily.Attractor att, int nbin) Calculates a measure of the proportion of the N-dimensional space defined by the bounds of an attractor.static Stream<AttractorFamily.Attractor>
getStrangeAttractors
(AttractorFamily family) Utility/example method to create a stream of strange attractors in a given family.static double[]
Returns a fixed size array containing random numbers suitable for use as attractor parameters.
-
Field Details
-
CLIFFORD
Clifford attractors; 2d, with four parameters. -
RAMPE
Rampe attractors; 3d, wit six parameters. -
HENON
Henon attractors; 2d, with three parameters (quite boring).
-
-
Constructor Details
-
AttractorFamily
Constructor.- Parameters:
name
- name of familyndim
- dimensionality of output pointsnparam
- number of numerical parameters required to define an attractormaxAbsParam
- the maximum absolute recommended value of each of the numerical parametersfillThresh
- guideline space filling factor above which attractors in this family look interesting (strange)
-
-
Method Details
-
getName
Returns the name of this family.- Returns:
- name
-
getDimCount
public int getDimCount()Returns the dimensionality of points in the sequence generated by attractors from this family.- Returns:
- output space dimensionality
-
getParamCount
public int getParamCount()Returns the number of parameters required to produce an attractor instance.- Returns:
- number of required numeric parameters
-
getMaxAbsParam
public double getMaxAbsParam()The maximum absolute value recommended for each of the input values (which should therefore be in the range [-maxAbsParam,+maxAbsParam]).- Returns:
- range for numeric parameters
-
getFillThreshold
public double getFillThreshold()Returns a guideline value for the space filling factor which represents an interesting (strange) attractor from this family. Many or most attractors in a given family are quite boring (not strange).- Returns:
- approximate space fraction threshold for strangeness
- See Also:
-
getEquations
Returns a list of lines giving a textual representation of the iteration formula used to generate attractors. The expectation is that this will be displayed in a fixed-width font, with one element per display line.- Returns:
- textual representation of iteration equations
-
getDocUrl
Returns a URL on the WWW at which additional or background information about this attractor family may be found.- Returns:
- documentation URL, or null if none known
-
createOperator
Returns the operator which produces the next ndim-element output point from the previous one.- Parameters:
params
- nparam-element list of numeric parameters defining the attractor- Returns:
- point generator function
-
createAttractor
Creates an attractor in this family by supplying numeric parameters.- Parameters:
params
- nparam-element array of numeric parametersseed
- initial point for iteration, or null for default- Returns:
- attractor
-
createAttractor
Creates a random attractor in this family.- Parameters:
rnd
- random seed- Returns:
- attractor
-
getExamples
public abstract double[][] getExamples()Returns a hard coded list of attractor parameter arrays that represent interesting members of this family. Suitable examples can be generated by runninggetStrangeAttractors(uk.ac.starlink.ttools.scheme.AttractorFamily)
. This list should contain at least one entry.- Returns:
- example parameter arrays for strange attractors
-
randoms
Returns a fixed size array containing random numbers suitable for use as attractor parameters. The values are reasonably "round", which means they can be written down without a lot of significant figures.- Parameters:
rnd
- random seedn
- required size of output arrayabsmax
- absolute maximum value- Returns:
- n-element array of values each in the range [-absmax,+absmax]
-
getSpaceFraction
Calculates a measure of the proportion of the N-dimensional space defined by the bounds of an attractor. This is a useful value for identifying "interesting" attractors; boring/non-strange ones may collapse down to a small number of points or lines, but ones which return a high value probably look nice.Of course the actual proporition for a finite number of points is effectively zero, but we bin the space up into a regular grid and count how many of the grid elements are hit during iteration.
- Parameters:
att
- attractor to characterisenbin
- number of bins along each axis- Returns:
- proportion of bins that are covered by a sequence of iterations
-
getStrangeAttractors
Utility/example method to create a stream of strange attractors in a given family.- Parameters:
family
- attractor family- Returns:
- stream of strange attractors
-