Package squidpony.squidmath
Class NeuralParticle
java.lang.Object
squidpony.squidmath.NeuralParticle
- All Implemented Interfaces:
Serializable
@Beta public class NeuralParticle extends Object implements Serializable
Creates a field of particles that tend to form a neuron image type
distribution. The distribution tends to reach towards the largest area of
empty space, but features many nice branches and curls as well.
If no points are added before the populate method is run, the center of the
area is chosen as the single pre-populated point.
Based on work by Nolithius
Source code is available on GitHub, as well as Google Code (now archived)
This class is marked Beta because no test or demo was ever written to use it. Who could be to blame for this omission...
Based on work by Nolithius
Source code is available on GitHub, as well as Google Code (now archived)
This class is marked Beta because no test or demo was ever written to use it. Who could be to blame for this omission...
- Author:
- Eben Howard - http://squidpony.com - howard@squidpony.com
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description NeuralParticle(int width, int height, int maxDistance, IRNG rng)
-
Method Summary
Modifier and Type Method Description void
add(Coord point)
Adds a single specific point to the distribution.int[][]
asIntMap(int scale)
Returns an integer mapping of the current distribution.List<Coord>
asList()
Returns a list of the current distribution.Coord
createPoint()
Creates a pip that falls within the required distance from the current distribution.void
populate(int quantity)
Populates the field with given number of points.
-
Constructor Details
-
Method Details
-
populate
Populates the field with given number of points.- Parameters:
quantity
- the number of points to insert
-
asList
Returns a list of the current distribution.- Returns:
- the distribution as a List of Coord
-
asIntMap
Returns an integer mapping of the current distribution.- Parameters:
scale
- the value that active points will hold- Returns:
- a 2D int array, with all elements equal to either 0 or scale
-
add
Adds a single specific point to the distribution.- Parameters:
point
- the Coord, also called a pip here, to insert
-
createPoint
Creates a pip that falls within the required distance from the current distribution. Does not add the pip to the distribution.- Returns:
- the created pip
-