Package | Description |
---|---|
squidpony |
Utilities that don't fit elsewhere in SquidLib; mostly text manipulation, compression, and helper code.
|
squidpony.squidai |
Tools for finding paths, optimizing targets for area-of-effect (AOE) abilities, and evaluating influence on a grid.
|
squidpony.squidgrid |
Tools for working with data on a grid, including LOS and FOV; overlaps with geometry code in squidpony.squidmath .
|
squidpony.squidgrid.mapping |
Tools specifically for generating maps and placing content in them, usually working with 2D char arrays.
|
squidpony.squidgrid.mapping.styled |
Support code for working with tiled dungeon generation; normally only
TilesetType is used outside SquidLib. |
squidpony.squidmath |
A very broad package containing random number generators, geometry tools, data structures, and noise functions.
|
Modifier and Type | Method and Description |
---|---|
protected static java.lang.String[] |
FakeLanguageGen.accentBoth(IRNG rng,
java.lang.String[] me,
double vowelInfluence,
double consonantInfluence) |
protected static java.lang.String[] |
FakeLanguageGen.accentConsonants(IRNG rng,
java.lang.String[] me,
double influence) |
protected static java.lang.String[] |
FakeLanguageGen.accentVowels(IRNG rng,
java.lang.String[] me,
double influence) |
T |
IColorCenter.getRandom(IRNG rng,
int opacity) |
T |
IColorCenter.Skeleton.getRandom(IRNG rng,
int opacity) |
protected java.lang.String[] |
FakeLanguageGen.merge1000(IRNG rng,
java.lang.String[] me,
java.lang.String[] other,
double otherInfluence) |
java.lang.StringBuilder |
FakeLanguageGen.Modifier.modify(IRNG rng,
java.lang.StringBuilder sb) |
static FakeLanguageGen |
FakeLanguageGen.randomLanguage(IRNG rng) |
java.lang.String |
FakeLanguageGen.sentence(IRNG rng,
int minWords,
int maxWords)
Generate a sentence from this FakeLanguageGen, using the given RNG, with the length in words between minWords and
maxWords, both inclusive.
|
java.lang.String |
FakeLanguageGen.sentence(IRNG rng,
int minWords,
int maxWords,
java.lang.String[] midPunctuation,
java.lang.String[] endPunctuation,
double midPunctuationFrequency)
Generate a sentence from this FakeLanguageGen using the specific RNG.
|
java.lang.String |
FakeLanguageGen.sentence(IRNG rng,
int minWords,
int maxWords,
java.lang.String[] midPunctuation,
java.lang.String[] endPunctuation,
double midPunctuationFrequency,
int maxChars)
Generate a sentence from this FakeLanguageGen using the given RNG that fits in the given length limit.
|
java.lang.String |
FakeLanguageGen.word(IRNG rng,
boolean capitalize)
Generate a word from this FakeLanguageGen using the specified RNG.
|
java.lang.String |
FakeLanguageGen.word(IRNG rng,
boolean capitalize,
int approxSyllables)
Generate a word from this FakeLanguageGen using the specified RNG with an approximate number of syllables.
|
java.lang.String |
FakeLanguageGen.word(IRNG rng,
boolean capitalize,
int approxSyllables,
regexodus.Pattern[] additionalChecks)
Generate a word from this FakeLanguageGen using the specified RNG with an approximate number of syllables.
|
Constructor and Description |
---|
Thesaurus(IRNG rng)
Constructs a new Thesaurus, seeding its RNG (used to shuffle word order) with the next long from the given RNG.
|
Modifier and Type | Field and Description |
---|---|
IRNG |
CustomDijkstraMap.rng
The RNG used to decide which one of multiple equally-short paths to take.
|
IRNG |
DijkstraMap.rng
The IRNG used to decide which one of multiple equally-short paths to take.
|
Constructor and Description |
---|
CustomDijkstraMap(char[][] level,
Adjacency adjacency,
IRNG rng)
Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
CustomDijkstraMap(char[][] level,
IRNG rng)
Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
CustomDijkstraMap(IRNG random)
Construct a CustomDijkstraMap without a level to actually scan.
|
DijkstraMap(char[][] level,
IRNG rng)
Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
DijkstraMap(char[][] level,
Measurement measurement,
IRNG rng)
Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
DijkstraMap(IRNG random)
Construct a DijkstraMap without a level to actually scan.
|
WaypointPathfinder(char[][] map,
DijkstraMap dijkstra,
IRNG rng)
Calculates and stores the doors and doors-like connections ("chokepoints") on the given map as waypoints.
|
WaypointPathfinder(char[][] map,
Radius radius,
IRNG rng)
Calculates and stores the doors and doors-like connections ("chokepoints") on the given map as waypoints.
|
WaypointPathfinder(char[][] map,
Radius radius,
IRNG rng,
boolean thickCorridors)
Calculates and stores the doors and doors-like connections ("chokepoints") on the given map as waypoints.
|
WaypointPathfinder(char[][] map,
Radius radius,
IRNG rng,
int fraction)
Calculates and stores the specified fraction of walkable points from map as waypoints.
|
Modifier and Type | Field and Description |
---|---|
IRNG |
DetailedMimic.random |
IRNG |
MimicWFC.random |
IRNG |
MultiSpill.rng
The IRNG used to decide how to randomly fill a space; can have its state set and read.
|
Modifier and Type | Method and Description |
---|---|
static boolean[][] |
MimicFill.fill(boolean[][] sample,
int size,
double temperature,
int iterations,
IRNG random)
The main part of MimicFill; generates a 2D boolean array that mimics the patterns present in the 2D boolean array
sample, but can produce a larger or smaller output 2D array than the sample.
|
static boolean[] |
MimicFill.fillSolo(boolean[][] sample,
int size,
double temperature,
int iterations,
IRNG random)
The main part of MimicFill; generates a 1D boolean array that, when used correctly, mimics the patterns present
in the 2D boolean array sample, but can produce a larger or smaller output 1D array than the sample.
|
Coord |
Radius.onUnitShape(double distance,
IRNG rng) |
Coord3D |
Radius.onUnitShape3D(double distance,
IRNG rng) |
E |
SpatialMap.randomElement(IRNG rng) |
SpatialMap.SpatialTriple<I,E> |
SpatialMap.randomEntry(IRNG rng) |
I |
SpatialMap.randomIdentity(IRNG rng) |
Coord |
SpatialMap.randomPosition(IRNG rng) |
boolean |
MimicWFC.run(IRNG rng,
int limit) |
Constructor and Description |
---|
DetailedMimic(AestheticDifference diff,
IRNG rng)
Constructor that uses the given RNG and the given AestheticDifference.
|
MultiSpill(char[][] level,
Measurement measurement,
IRNG random)
Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
MultiSpill(IRNG random)
Construct a Spill without a level to actually scan.
|
MultiSpill(short[][] level,
Measurement measurement,
IRNG random)
Used to construct a Spill from the output of another, specifying a distance calculation and RNG.
|
Spill(char[][] level,
Measurement measurement,
IRNG random)
Constructor meant to take a char[][] returned by DungeonBoneGen.generate(), or any other
char[][] where '#' means a wall and anything else is a walkable tile.
|
Spill(IRNG random)
Construct a Spill without a level to actually scan.
|
Modifier and Type | Field and Description |
---|---|
IRNG |
BasicCaveGenerator.random |
protected IRNG |
LanesMapGenerator.random |
IRNG |
ConnectingMapGenerator.rng |
IRNG |
DenseRoomMapGenerator.rng |
IRNG |
FlowingCaveGenerator.rng |
IRNG |
MixedGenerator.rng |
IRNG |
OrganicMapGenerator.rng |
IRNG |
PacMazeGenerator.rng |
Modifier and Type | Method and Description |
---|---|
static OrderedSet<Coord> |
MixedGenerator.basicPoints(int width,
int height,
IRNG rng)
Mainly for internal use; this is used by
MixedGenerator(int, int, IRNG) to get its room positions. |
static java.util.List<Coord> |
MixedGenerator.cleanPoints(int width,
int height,
IRNG rng)
Mainly for internal use; this was used by
MixedGenerator(int, int, IRNG) to get its room positions, and
you can choose to use it with new MixedGenerator(width, height, rng, cleanPoints(width, height, rng)) . |
static java.util.ArrayList<java.lang.String> |
WildMap.contentByBiome(int biome,
IRNG rng)
Gets a list of Strings that are really just the names of types of terrain feature for wilderness areas.
|
static java.util.ArrayList<Coord> |
DungeonUtility.ensurePath(char[][] map,
IRNG rng,
char replacement,
char... blocking)
Ensures a path exists in a rough ring around the map by first creating the path (using
DungeonUtility.pointPath(int, int, IRNG) with the given IRNG), then finding chars in blocking that are on that path and
replacing them with replacement. |
static java.util.ArrayList<java.lang.String> |
WildMap.floorsByBiome(int biome,
IRNG rng)
Gets a list of Strings that are really just the names of types of floor tile for wilderness areas.
|
static Coord |
DungeonUtility.getRandomCell(IRNG rng,
char[][] map,
java.util.Set<java.lang.Character> acceptable,
int frustration) |
static java.util.ArrayList<java.lang.String> |
WildMap.makeShuffledRepeats(IRNG rng,
java.lang.Object... rest) |
static java.util.ArrayList<java.lang.String> |
WildMap.makeVegetation(IRNG rng,
int size,
double monoculture,
FakeLanguageGen naming) |
static java.util.ArrayList<Coord> |
DungeonUtility.pointPath(int width,
int height,
IRNG rng) |
Constructor and Description |
---|
BasicCaveGenerator(int width,
int height,
IRNG random) |
ClassicRogueMapGenerator(int horizontalRooms,
int verticalRooms,
int dungeonWidth,
int dungeonHeight,
int minRoomWidth,
int maxRoomWidth,
int minRoomHeight,
int maxRoomHeight,
IRNG rng)
Initializes the generator to turn out random dungeons within the specific
parameters.
|
ConnectingMapGenerator(int width,
int height,
int roomWidth,
int roomHeight,
IRNG random)
Exactly like
ConnectingMapGenerator(int, int, int, int, IRNG, int) with wallThickness 2. |
ConnectingMapGenerator(int width,
int height,
int roomWidth,
int roomHeight,
IRNG random,
int wallThickness) |
ConnectingMapGenerator(int width,
int height,
int roomWidth,
int roomHeight,
IRNG random,
int wallThickness,
double divideRooms) |
ConnectingMapGenerator(int width,
int height,
IRNG random)
Determines room width and room height by dividing width or height by 10; wallThickness is 2.
|
DenseRoomMapGenerator(int width,
int height,
IRNG rng) |
DividedMazeGenerator(int width,
int height,
IRNG rng)
Sets up the generator to make mazes the given width and height.
|
DungeonGenerator(int width,
int height,
IRNG rng)
Make a DungeonGenerator with the given height, width, and RNG.
|
DungeonUtility(IRNG rng) |
FlowingCaveGenerator(int width,
int height,
TilesetType type,
IRNG rng) |
GrowingTreeMazeGenerator(int width,
int height,
IRNG rng) |
LanesMapGenerator(int width,
int height,
IRNG rng,
int lanes)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
MixedGenerator(int width,
int height,
IRNG rng)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
MixedGenerator(int width,
int height,
IRNG rng,
java.util.List<Coord> sequence)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
MixedGenerator(int width,
int height,
IRNG rng,
java.util.Map<Coord,java.util.List<Coord>> connections)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
MixedGenerator(int width,
int height,
IRNG rng,
java.util.Map<Coord,java.util.List<Coord>> connections,
float roomSizeMultiplier)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
ModularMapGenerator(int width,
int height,
IRNG rng)
Make a ModularMapGenerator with the given height, width, and RNG.
|
OrganicMapGenerator(double noiseMin,
double noiseMax,
int width,
int height,
IRNG rng) |
OrganicMapGenerator(int width,
int height,
IRNG rng) |
PacMazeGenerator(int width,
int height,
int wallBreadth,
int passageBreadth,
IRNG rng) |
PacMazeGenerator(int width,
int height,
IRNG rng) |
PoliticalMapper(IRNG random)
Constructs a SpillWorldMap using the given world name, and uses the world name as the
basis for all future random generation in this object.
|
SectionDungeonGenerator(int width,
int height,
IRNG rng)
Make a SectionDungeonGenerator with the given height, width, and RNG.
|
SerpentDeepMapGenerator(int width,
int height,
int depth,
IRNG rng)
This prepares a map generator that will generate a map with the given width, height and depth, using the given
IRNG.
|
SerpentDeepMapGenerator(int width,
int height,
int depth,
IRNG rng,
double branchingChance)
This prepares a map generator that will generate a map with the given width, height and depth, using the given
IRNG, and will branch out to other nearby rooms that (probably) do not have staircases between layers.
|
SerpentMapGenerator(int width,
int height,
IRNG rng)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SerpentMapGenerator(int width,
int height,
IRNG random,
boolean symmetrical)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SerpentMapGenerator(int width,
int height,
IRNG rng,
double branchingChance)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SerpentMapGenerator(int width,
int height,
IRNG random,
double branchingChance,
boolean symmetrical)
This prepares a map generator that will generate a map with the given width and height, using the given IRNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
java.util.List<Coord> sequence)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
OrderedMap<Coord,java.util.List<Coord>> connections)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
OrderedMap<Coord,java.util.List<Coord>> connections,
float roomSizeMultiplier)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
SymmetryDungeonGenerator(int width,
int height,
IRNG rng,
OrderedSet<Coord> sequence)
This prepares a map generator that will generate a map with the given width and height, using the given RNG.
|
ThinDungeonGenerator(int width,
int height,
IRNG rng)
Make a DungeonGenerator with the given height, width, and RNG.
|
ThinDungeonGenerator(int width,
int height,
IRNG rng,
int roomShape,
int corridorShape,
int caveShape)
Make a DungeonGenerator with the given height, width, and RNG for generating random features.
|
Modifier and Type | Field and Description |
---|---|
IRNG |
DungeonBoneGen.rng
|
Modifier and Type | Method and Description |
---|---|
IRNG |
DungeonBoneGen.getRng()
Gets the current RNG.
|
Modifier and Type | Method and Description |
---|---|
void |
DungeonBoneGen.setRng(IRNG rng)
Sets the current RNG.
|
Constructor and Description |
---|
DungeonBoneGen(IRNG random)
Constructs a DungeonBoneGen that uses the given IRNG.
|
Modifier and Type | Interface and Description |
---|---|
interface |
IStatefulRNG
Simply groups the two interfaces
IRNG and StatefulRandomness so some implementations of IRNG can have
their states read from and written to. |
Modifier and Type | Class and Description |
---|---|
class |
AbstractRNG
A helper class for implementing
IRNG without so much busy-work. |
class |
CriticalRNG
A type of RNG that can generate values larger or smaller than the normal maximum or minimum, based on a modifier.
|
class |
DeckRNG
An RNG variant that has 16 possible grades of value it can produce and shuffles them like a deck of cards.
|
class |
DharmaRNG
An alteration to a RandomnessSource that attempts to produce values that are perceived as fair to an imperfect user.
|
class |
DistributedRNG
An implementation of
IRNG that allows specifying a distribution for all random numbers it produces via a
IDistribution.SimpleDistribution value. |
class |
EditRNG
A subclass of StatefulRNG (and thus RNG) that allows customizing many parts of the random number generation.
|
class |
GWTRNG
An IRNG implementation that is meant to provide random numbers very quickly when targeting GWT but also to produce
the same numbers when used on desktop, Android, or other platforms, and that can have its state read as a
StatefulRandomness.
|
class |
MoonwalkRNG
An IRNG implementation that allows the extra functionality of a StatefulRandomness and a SkippingRandomness, as well
as allowing reverse-lookup of the state that produced a long using the static
MoonwalkRNG.inverseNextLong(long) method,
and distance checks between two generated numbers with the static MoonwalkRNG.distance(long, long) method. |
class |
RNG
A wrapper class for working with random number generators in a more friendly way.
|
class |
SilkRNG
An IStatefulRNG implementation that is meant to provide random numbers very quickly when targeting GWT but also to
produce the same numbers when used on desktop, Android, or other platforms, and that can have its state read as a
StatefulRandomness; it is thus like
GWTRNG but should perform better on recent desktop JVMs. |
class |
StatefulRNG
A slight variant on RNG that always uses a stateful RandomessSource and so can have its state
set or retrieved using setState() or getState().
|
class |
TweakRNG
Somewhat experimental RNG that can be configured to smoothly transition between producing mostly values in the
center of its range, to producing more values at or near the extremes, as well as favoring high or low results.
|
Modifier and Type | Field and Description |
---|---|
IRNG |
GapShuffler.rng |
IRNG |
RandomBias.rng |
IRNG |
TwistedLine.rng |
Modifier and Type | Method and Description |
---|---|
abstract IRNG |
AbstractRNG.copy()
Creates a copy of this IRNG; it will generate the same random numbers, given the same calls in order, as this
IRNG at the point copy() is called.
|
IRNG |
TwistedLine.getRng() |
IRNG |
GapShuffler.getRNG() |
Modifier and Type | Method and Description |
---|---|
static int[][] |
BlueNoise.blueSpill(int[][] toFill,
int spillerLimit,
IRNG rng)
Modifies
toFill in-place by filling it with the (seeded variant) blue noise of this class, finding any
points with values less than spillerLimit when brought into a 0-255 range, and then expanding those
points pseudo-randomly while keeping the same value for any expanded range as its original point. |
static int[][] |
BlueNoise.blueSpill(int width,
int height,
int spillerLimit,
IRNG rng)
Generates a 2D int array (as with
new int[width][height] ) and fills it with the (seeded variant) blue
noise of this class, finding any points with values less than spillerLimit when brought into a 0-255
range, and then expanding those points pseudo-randomly while keeping the same value for any expanded range as its
original point. |
Coord |
Region.getRandomCoord(IRNG rng)
Gets a single random Coord from this using the given RNG (which can be seeded); returns null if this is empty.
|
int |
IntVLA.getRandomElement(IRNG random) |
static double[] |
TuringPattern.initialize(int width,
int height,
IRNG rng)
Initializes a substance array that can be given to other static methods.
|
static double[] |
TuringPattern.initializeInto(double[] substance,
IRNG rng)
Initializes a substance array that can be given to other static methods.
|
static java.util.ArrayList<Coord> |
WobblyLine.line(int startX,
int startY,
int endX,
int endY,
int width,
int height,
double weight,
IRNG rng)
Draws a line from (startX, startY) to (endX, endY) using the Drunkard's Walk algorithm.
|
double |
BathtubDistribution.nextDouble(IRNG rng)
Gets a double between
IDistribution.SimpleDistribution.getLowerBound() and IDistribution.SimpleDistribution.getUpperBound() that obeys this distribution. |
double |
CurvedBoundedDistribution.nextDouble(IRNG rng) |
double |
ExponentialDistribution.nextDouble(IRNG rng) |
double |
GaussianDistribution.nextDouble(IRNG rng) |
double |
IDistribution.nextDouble(IRNG rng)
Gets a double between
IDistribution.getLowerBound() and IDistribution.getUpperBound() that obeys this distribution. |
double |
KumaraswamyDistribution.nextDouble(IRNG rng)
Gets a double between
KumaraswamyDistribution.getLowerBound() and KumaraswamyDistribution.getUpperBound() that obeys this distribution. |
double |
SpikeDistribution.nextDouble(IRNG rng)
Gets a double between
SpikeDistribution.getLowerBound() and SpikeDistribution.getUpperBound() that obeys this distribution. |
double |
SpikeDistribution.SimpleSpikeDistribution.nextDouble(IRNG rng)
Gets a double between
IDistribution.SimpleDistribution.getLowerBound() and IDistribution.SimpleDistribution.getUpperBound() that obeys this distribution. |
int |
IntSet.random(IRNG rng)
Gets a random int from this IntSet, using the given
IRNG to generate random values. |
A |
K2.randomA(IRNG random)
Gets a random A from this K2 using the given IRNG.
|
A |
K2V1.randomA(IRNG random)
Gets a random A from this K2V1 using the given IRNG.
|
B |
K2.randomB(IRNG random)
Gets a random B from this K2 using the given IRNG.
|
B |
K2V1.randomB(IRNG random)
Gets a random B from this K2V1 using the given IRNG.
|
java.util.Map.Entry<K,java.lang.Integer> |
Arrangement.randomEntry(IRNG rng)
Gets a random entry from this Arrangement in constant time, using the given IRNG to generate a random number.
|
IntDoubleOrderedMap.MapEntry |
IntDoubleOrderedMap.randomEntry(IRNG rng)
Gets a random entry from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
IntIntOrderedMap.MapEntry |
IntIntOrderedMap.randomEntry(IRNG rng)
Gets a random entry from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
java.util.Map.Entry<K,V> |
OrderedMap.randomEntry(IRNG rng)
Gets a random entry from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
K |
OrderedSet.randomItem(IRNG rng)
Gets a random value from this OrderedSet in constant time, using the given IRNG to generate a random number.
|
K |
Arrangement.randomKey(IRNG rng)
Gets a random key from this Arrangement in constant time, using the given IRNG to generate a random number.
|
int |
IntDoubleOrderedMap.randomKey(IRNG rng)
Gets a random key from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
int |
IntIntOrderedMap.randomKey(IRNG rng)
Gets a random key from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
K |
OrderedMap.randomKey(IRNG rng)
Gets a random key from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
Coord[] |
GreasedRegion.randomPortion(IRNG rng,
int size) |
static java.util.ArrayList<Coord> |
CoordPacker.randomPortion(short[] packed,
int size,
IRNG rng)
Gets a fixed number of randomly chosen positions that are "on" in the given packed array, without unpacking it,
and returns a List of Coord with a count equal to size (or less if there aren't enough "on" cells).
|
Q |
K2V1.randomQ(IRNG random)
Gets a random Q from this K2V1 using the given IRNG.
|
GreasedRegion |
GreasedRegion.randomRegion(IRNG rng,
int size) |
static Coord[] |
CoordPacker.randomSample(short[] packed,
double fraction,
IRNG rng)
Gets a random subset of positions that are "on" in the given packed array, without unpacking it, and returns
them as a Coord[].
|
GreasedRegion |
GreasedRegion.randomScatter(IRNG rng,
int minimumDistance)
Modifies this GreasedRegion so it contains a random subset of its previous contents, choosing cells so that the
distance between any two "on" cells is at least
minimumDistance , with at least one cell as "on" if any
were "on" in this originally. |
GreasedRegion |
GreasedRegion.randomScatter(IRNG rng,
int minimumDistance,
int limit)
Modifies this GreasedRegion so it contains a random subset of its previous contents, choosing cells so that the
distance between any two "on" cells is at least
minimumDistance , with at least one cell as "on" if any
were "on" in this originally. |
Coord[] |
GreasedRegion.randomSeparated(double fraction,
IRNG rng)
Don't use this in new code; prefer
GreasedRegion.mixedRandomSeparated(double, int, long) with a random long as the
last parameter. |
Coord[] |
GreasedRegion.randomSeparated(double fraction,
IRNG rng,
int limit)
Don't use this in new code; prefer
GreasedRegion.mixedRandomSeparated(double, int, long) with a random long as the
last parameter. |
Region |
Region.randomSeparated(int separation,
IRNG rng)
Takes this region and walks through its Coords in chunks with length equal to separation, creating a new Region
where one randomly-chosen Coord in each chunk is kept and the others are discarded.
|
static Coord[] |
CoordPacker.randomSeparated(short[] packed,
int separation,
IRNG rng)
Gets the positions that are "on" in the given packed array, without unpacking it, repeatedly goes through a
number of "on" cells equal to fraction and stores a random one of those cells as a Coord, and returns the
accumulated random portion of positions as a Coord[].
|
static Coord |
PoissonDisk.randomUnblockedTile(Coord minPosition,
Coord maxPosition,
char[][] map,
IRNG rng,
java.util.HashSet<java.lang.Character> blocked)
Finds a random Coord where the x and y match up to a [x][y] location on map that has any value not in blocking.
|
int |
Arrangement.randomValue(IRNG rng)
Gets a random value from this Arrangement in constant time, using the given IRNG to generate a random number.
|
double |
IntDoubleOrderedMap.randomValue(IRNG rng)
Gets a random value from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
int |
IntIntOrderedMap.randomValue(IRNG rng)
Gets a random value from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
V |
OrderedMap.randomValue(IRNG rng)
Gets a random value from this OrderedMap in constant time, using the given IRNG to generate a random number.
|
GreasedRegion |
GreasedRegion.refill(IRNG random,
int width,
int height)
Reassigns this GreasedRegion by filling it with random values from random, reusing the current data storage
(without extra allocations) if this.width == width and this.height == height, and typically assigning
approximately half of the cells in this to "on" and the rest to off.
|
static OrderedSet<Coord> |
PoissonDisk.sampleCircle(Coord center,
float radius,
float minimumDistance,
int maxX,
int maxY,
int pointsPerIteration,
IRNG rng)
Get a list of Coords, each randomly positioned around the given center out to the given radius (measured with
Euclidean distance, so a true circle), but with the given minimum distance from any other Coord in the list.
|
static OrderedSet<Coord> |
PoissonDisk.sampleMap(char[][] map,
float minimumDistance,
IRNG rng,
java.lang.Character... blocking) |
static OrderedSet<Coord> |
PoissonDisk.sampleMap(Coord minPosition,
Coord maxPosition,
char[][] map,
float minimumDistance,
IRNG rng,
java.lang.Character... blocking) |
static OrderedSet<Coord> |
PoissonDisk.sampleRectangle(Coord minPosition,
Coord maxPosition,
float minimumDistance,
int maxX,
int maxY,
int pointsPerIteration,
IRNG rng)
Get a list of Coords, each randomly positioned within the rectangle between the given minPosition and
maxPosition, but with the given minimum distance from any other Coord in the list.
|
void |
Dice.setRandom(IRNG rng)
Sets the random number generator to be used.
|
void |
TwistedLine.setRng(IRNG rng) |
void |
GapShuffler.setRNG(IRNG rng)
Sets the IRNG this uses to shuffle the order of elements, always copying the given IRNG before using it.
|
void |
GapShuffler.setRNG(IRNG rng,
boolean shareRNG)
Sets the IRNG this uses to shuffle the order of elements, optionally sharing a reference between outside code and
the internal rng (when
shareRNG is true). |
Arrangement<K> |
Arrangement.shuffle(IRNG rng)
Randomly alters the iteration order for this Arrangement using the given IRNG to shuffle.
|
void |
DelaunayTriangulator.shuffle(IRNG rng)
Creates a random permutation of the specified point set.
|
IntDoubleOrderedMap |
IntDoubleOrderedMap.shuffle(IRNG rng)
Randomly alters the iteration order for this OrderedMap using the given IRNG to shuffle.
|
IntIntOrderedMap |
IntIntOrderedMap.shuffle(IRNG rng)
Randomly alters the iteration order for this OrderedMap using the given IRNG to shuffle.
|
IntVLA |
IntVLA.shuffle(IRNG random)
Shuffles this IntVLA in place using the given IRNG.
|
K2<A,B> |
K2.shuffle(IRNG rng)
Generates a random ordering with rng and applies the same ordering to all kinds of keys this has; they will
maintain their current association to other keys but their ordering/indices will change.
|
K2V1<A,B,Q> |
K2V1.shuffle(IRNG rng)
Generates a random ordering with rng and applies the same ordering to all keys and values this has; they will
maintain their current association to other keys and values but their ordering/indices will change.
|
OrderedMap<K,V> |
OrderedMap.shuffle(IRNG rng)
Randomly alters the iteration order for this OrderedMap using the given IRNG to shuffle.
|
OrderedSet<K> |
OrderedSet.shuffle(IRNG rng)
Randomly alters the iteration order for this OrderedSet using the given IRNG to shuffle.
|
void |
Voronoi.shuffle(IRNG rng)
Creates a random permutation of the specified point set.
|
Coord |
GreasedRegion.singleRandom(IRNG rng)
Gets a single random Coord from the "on" positions in this GreasedRegion, or the Coord (-1,-1) if this is empty.
|
static Coord |
CoordPacker.singleRandom(short[] packed,
IRNG rng)
Gets a single randomly chosen position that is "on" in the given packed array, without unpacking it, and returns
it as a Coord or returns null of the array is empty.
|
int |
GreasedRegion.singleRandomTight(IRNG rng) |
GreasedRegion |
GreasedRegion.spill(GreasedRegion bounds,
int volume,
IRNG rng)
A randomized flood-fill that modifies this GreasedRegion so it randomly adds adjacent cells while staying inside
the "on" cells of
bounds , until GreasedRegion.size() is equal to volume or there are no more cells
this can expand into. |
static short[] |
CoordPacker.spill(short[] bounds,
short[] start,
int volume,
IRNG rng)
Given a packed array encoding a larger area, a packed array encoding one or more points inside bounds, an IRNG,
and a volume in cells, expands a random cell in start in a random Manhattan (diamond) direction equal, then
continues to expand from random cells in start or the expanded area until it has filled volume cells, limiting
any expansion to within bounds and returning the final expanded (limited) packed data.
|
Constructor and Description |
---|
Dice(IRNG rng)
Creates a new dice roller that uses the given IRNG, which can be seeded before it's given here.
|
GapShuffler(java.util.Collection<T> items,
IRNG rng,
boolean shareRNG)
Constructor that takes any Collection of T, shuffles it with the given RNG, and can then iterate infinitely
through mostly-random shuffles of the given collection.
|
GapShuffler(T[] items,
IRNG rng,
boolean shareRNG)
Constructor that takes any Collection of T, shuffles it with the given RNG, and can then iterate infinitely
through mostly-random shuffles of the given collection.
|
GreasedRegion(IRNG random,
int width,
int height)
Constructor for a random GreasedRegion of the given width and height, typically assigning approximately half of
the cells in this to "on" and the rest to off.
|
NeuralParticle(int width,
int height,
int maxDistance,
IRNG rng) |
RandomBias(IRNG rng) |
RandomBias(IRNG rng,
java.util.Map<java.lang.String,java.lang.Double> mapping) |
RandomBias(IRNG rng,
java.util.Map<java.lang.String,java.lang.Double> mapping,
int distribution) |
TwistedLine(int width,
int height,
IRNG rng) |
Copyright © Eben Howard 2012–2022. All rights reserved.