Uses of Package
squidpony.squidmath
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.squidai.graph |
Graphs and graph algorithms used primarily (but not exclusively) for pathfinding.
|
squidpony.squidgrid |
Tools for working with data on a grid, including LOS and FOV; overlaps with geometry code in squidpony.squidmath .
|
squidpony.squidgrid.iterator |
Iterators that allow traversal of
Coord points on a map's grid. |
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.squidgrid.zone |
Ways to represent different types of areas in 2D space; not recommended, most new code uses
GreasedRegion . |
squidpony.squidmath |
A very broad package containing random number generators, geometry tools, data structures, and noise functions.
|
-
Classes in squidpony.squidmath used by squidpony Class Description Arrangement A bi-directional mapping of objects to positions in an ordering (which this generates), and vice versa.Coord A 2D coordinate with (constant) x and y fields.CrossHash.IHasher An interface that can be used to move the logic for the hashCode() and equals() methods from a class' methods to an implementation of IHasher that certain collections in SquidLib can use.EnumOrderedMap A simple alternative to EnumMap that has a zero-argument constructor (which makes serialization easier) but is a little less efficient.EnumOrderedSet A simple Set of Enum items (which are already unique if used in a normal Set) that keeps insertion order.GapShuffler Meant to take a fixed-size set of items and produce a shuffled stream of them such that an element is never chosen in quick succession; that is, there should always be a gap between the same item's occurrences.GreasedRegion Region encoding of on/off information about areas using bitsets; uncompressed (fatty), but fast (greased lightning).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.IntIntOrderedMap An int-key and int-value insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified (inOrderedMap
) to support constant-time indexed access of keys, values, and entries, and reordering.IntVLA A resizable, ordered or unordered variable-length int array.IRNG Interface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource
).IStatefulRNG Simply groups the two interfacesIRNG
andStatefulRandomness
so some implementations of IRNG can have their states read from and written to.K2 An ordered bidirectional map-like data structure, with unique A keys and unique B keys updated together like a map that can be queried by A keys, B keys, or int indices.OrderedMap A generic insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified to support constant-time indexed access of keys, values, and entries, reordering, and optional hash strategies for unusual keys, such as arrays or usually-dense numeric values.OrderedSet A generic linked hash set with with a fast implementation, originally from fastutil as ObjectLinkedOpenHashSet but modified to support indexed access of items, reordering, and optional hash strategies for array keys (which fastutil does differently).RNG A wrapper class for working with random number generators in a more friendly way.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 likeGWTRNG
but should perform better on recent desktop JVMs.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().UnorderedMap A generic unordered hash map; generally preferHashMap
unless you need array keys.UnorderedSet A generic unordered hash set with with a fast implementation, based onOrderedSet
in this library, which is based on the fastutil library's ObjectLinkedOpenHashSet class; the ordering and indexed access have been removed to potentially reduce the time cost of insertion and removal at the expense of increasing time cost for access by index.WeightedTable A different approach to the same taskProbabilityTable
solves, though this only looks up an appropriate index instead of also storing items it can choose; allows positive doubles for weights but does not allow nested tables for simplicity. -
Classes in squidpony.squidmath used by squidpony.squidai Class Description Coord A 2D coordinate with (constant) x and y fields.GreasedRegion Region encoding of on/off information about areas using bitsets; uncompressed (fatty), but fast (greased lightning).IntDoubleOrderedMap An int-key and int-value insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified (inOrderedMap
) to support constant-time indexed access of keys, values, and entries, and reordering.IntVLA A resizable, ordered or unordered variable-length int array.IRNG Interface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource
).OrderedMap A generic insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified to support constant-time indexed access of keys, values, and entries, reordering, and optional hash strategies for unusual keys, such as arrays or usually-dense numeric values.OrderedSet A generic linked hash set with with a fast implementation, originally from fastutil as ObjectLinkedOpenHashSet but modified to support indexed access of items, reordering, and optional hash strategies for array keys (which fastutil does differently).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(). -
Classes in squidpony.squidmath used by squidpony.squidai.graph Class Description BinaryHeap.Node A binary heap node.Coord A 2D coordinate with (constant) x and y fields.OrderedMap A generic insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified to support constant-time indexed access of keys, values, and entries, reordering, and optional hash strategies for unusual keys, such as arrays or usually-dense numeric values. -
Classes in squidpony.squidmath used by squidpony.squidgrid Class Description Coord A 2D coordinate with (constant) x and y fields.Coord3D Generic three dimensional coordinate class.GreasedRegion Region encoding of on/off information about areas using bitsets; uncompressed (fatty), but fast (greased lightning).IntDoubleOrderedMap An int-key and int-value insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified (inOrderedMap
) to support constant-time indexed access of keys, values, and entries, and reordering.IntVLA A resizable, ordered or unordered variable-length int array.IRNG Interface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource
).IStatefulRNG Simply groups the two interfacesIRNG
andStatefulRandomness
so some implementations of IRNG can have their states read from and written to.OrderedMap A generic insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified to support constant-time indexed access of keys, values, and entries, reordering, and optional hash strategies for unusual keys, such as arrays or usually-dense numeric values.OrderedSet A generic linked hash set with with a fast implementation, originally from fastutil as ObjectLinkedOpenHashSet but modified to support indexed access of items, reordering, and optional hash strategies for array keys (which fastutil does differently). -
Classes in squidpony.squidmath used by squidpony.squidgrid.iterator Class Description Coord A 2D coordinate with (constant) x and y fields. -
Classes in squidpony.squidmath used by squidpony.squidgrid.mapping Class Description Arrangement A bi-directional mapping of objects to positions in an ordering (which this generates), and vice versa.CellularAutomaton Created by Tommy Ettinger on 7/3/2017.Coord A 2D coordinate with (constant) x and y fields.FastNoise A wide range of noise functions that can all be called from one configurable object.GreasedRegion Region encoding of on/off information about areas using bitsets; uncompressed (fatty), but fast (greased lightning).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.IntVLA A resizable, ordered or unordered variable-length int array.IRNG Interface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource
).IStatefulRNG Simply groups the two interfacesIRNG
andStatefulRandomness
so some implementations of IRNG can have their states read from and written to.Noise.InverseLayered2D Noise.Noise2D Noise.Noise3D Noise.Noise4D Noise.Ridged2D OrderedMap A generic insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified to support constant-time indexed access of keys, values, and entries, reordering, and optional hash strategies for unusual keys, such as arrays or usually-dense numeric values.OrderedSet A generic linked hash set with with a fast implementation, originally from fastutil as ObjectLinkedOpenHashSet but modified to support indexed access of items, reordering, and optional hash strategies for array keys (which fastutil does differently).RegionMap A small extension of OrderedMap that specifically handlesshort[]
regions as produced byCoordPacker
.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().WeightedTable A different approach to the same taskProbabilityTable
solves, though this only looks up an appropriate index instead of also storing items it can choose; allows positive doubles for weights but does not allow nested tables for simplicity. -
Classes in squidpony.squidmath used by squidpony.squidgrid.mapping.styled Class Description GreasedRegion Region encoding of on/off information about areas using bitsets; uncompressed (fatty), but fast (greased lightning).IRNG Interface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource
). -
Classes in squidpony.squidmath used by squidpony.squidgrid.zone Class Description Coord A 2D coordinate with (constant) x and y fields. -
Classes in squidpony.squidmath used by squidpony.squidmath Class Description AbstractRNG A helper class for implementingIRNG
without so much busy-work.Arrangement A bi-directional mapping of objects to positions in an ordering (which this generates), and vice versa.Arrangement.KeyIterator An iterator on keys.Arrangement.KeySet Arrangement.ValueIterator An iterator on values.AStarSearch Performs A* search to find the shortest path between two Coord points.AStarSearch.SearchType The type of heuristic to use.BasicRandom32 A low-quality but very fast RNG that has no apparent visual artifacts here; uses Mark Overton's CMR subcycle generator type, but modified to be especially GWT-friendly.BasicRandom64 A high-quality and very fast RNG that has no apparent visual artifacts here; uses Mark Overton's CMR subcycle generator type, with a multiplication on the output.BathtubDistribution An IDistribution that produces results between 0.0 inclusive and 1.0 exclusive, but is much more likely to produce results near 0.0 or 1.0, further from 0.5.BinaryHeap.Node A binary heap node.CellularAutomaton Created by Tommy Ettinger on 7/3/2017.ChaosRNG An RNG that cannot be seeded and should be fairly hard to predict what it will return next.ClassicNoise "Classic Perlin" noise, as opposed to the Simplex Noise also created by Ken Perlin (which is produced bySeededNoise
; both can be produced byFastNoise
).Coord A 2D coordinate with (constant) x and y fields.Coord3D Generic three dimensional coordinate class.CoordDouble Coord using double values for x and y instead of int.CosmicNumbering Like a kind of RNG, but fully deterministic in a way that depends on a "connected" double array.CrossHash.Curlup Like Yolk, this is a class for hash functors, each an object with a 64-bit long seed.CrossHash.IHasher An interface that can be used to move the logic for the hashCode() and equals() methods from a class' methods to an implementation of IHasher that certain collections in SquidLib can use.CrossHash.Mist A whole cluster of Wisp-like hash functions that sacrifice a small degree of speed, but can be built with up to 128 bits of salt values that help to obscure what hashing function is actually being used.CrossHash.Yolk Like Mist, this is a class for hash functors, each an object with a 64-bit long seed, but it uses about the same algorithm asCrossHash.Water
instead of the older, less-robust style Mist uses.CurvedBoundedDistribution An IDistribution that allows a parameter to determine how many calls toIRNG.nextDouble()
to make and average whenever a double is requested.DeckRNG An RNG variant that has 16 possible grades of value it can produce and shuffles them like a deck of cards.DelaunayTriangulator.Edge DelaunayTriangulator.Triangle DharmaRNG An alteration to a RandomnessSource that attempts to produce values that are perceived as fair to an imperfect user.DistributedRNG An implementation ofIRNG
that allows specifying a distribution for all random numbers it produces via aIDistribution.SimpleDistribution
value.DiverRNG A very-high-quality StatefulRandomness that is the fastest 64-bit generator in this library that passes statistical tests and is one-dimensionally equidistributed across all 64-bit outputs.EditRNG A subclass of StatefulRNG (and thus RNG) that allows customizing many parts of the random number generation.ExponentialDistribution An IDistribution that implements the Exponential distribution.FastNoise A wide range of noise functions that can all be called from one configurable object.FlawedPointHash An interface for point hashes that are statistically biased, as well as a holder for inner classes that implement this.FlawedRandomness An interface to indicate aRandomnessSource
that is intentionally flawed to create output patterns where a truly random sequence would have none.FlawedRandomness.AddRotate A flawed randomness source that adds a rotation of its state, to its state, every generation.FlawedRandomness.BigCounter A flawed randomness source that depends almost entirely on its starting state for any random-seeming results in its output.FoamNoise An unusual continuous noise generator that tends to produce organic-looking forms, currently supporting 2D, 3D, 4D and 6D.GaussianDistribution An IDistribution that produces double results with a Gaussian (normal) distribution.GearRNG A larger-period generator with 127 bits of state (two longs, one is always odd), a period of 2 to the 127, and what should be slightly better speed than the related OrbitRNG.GlitchNoise A noise generator for 1D, 2D, 3D, 4D, or 6D noise that should look "glitchy", with waves of changing values moving through triangular shapes.GoatRNG A larger-period generator with 128 bits of state, good speed, and high quality in PractRand testing; it is at least 1-dimensionally equidistributed.GreasedRegion Region encoding of on/off information about areas using bitsets; uncompressed (fatty), but fast (greased lightning).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.HashCommon.EnumHasher IDistribution A way to take anIRNG
and get one or more random numbers from it to produce a double in some statistical distribution, such as Gaussian (also called the normal distribution), exponential, or various simpler schemes that don't have common mathematical names.IDistribution.SimpleDistribution IFlawed An empty marker interface to indicate that an implementor has known or intentional issues with a key property of its functionality.IntDoubleOrderedMap An int-key and int-value insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified (inOrderedMap
) to support constant-time indexed access of keys, values, and entries, and reordering.IntDoubleOrderedMap.FastEntryIterator IntDoubleOrderedMap.KeyIterator An iterator on keys.IntDoubleOrderedMap.KeySet IntDoubleOrderedMap.MapEntry The entry class for a OrderedMap does not record key and value, but rather the position in the hash table of the corresponding entry.IntDoubleOrderedMap.MapEntrySet IntDoubleOrderedMap.ValueCollection IntDoubleOrderedMap.ValueIterator An iterator on values.IntIntOrderedMap An int-key and int-value insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified (inOrderedMap
) to support constant-time indexed access of keys, values, and entries, and reordering.IntIntOrderedMap.FastEntryIterator IntIntOrderedMap.KeyIterator An iterator on keys.IntIntOrderedMap.KeySet IntIntOrderedMap.MapEntry The entry class for a OrderedMap does not record key and value, but rather the position in the hash table of the corresponding entry.IntIntOrderedMap.MapEntrySet IntIntOrderedMap.ValueCollection IntIntOrderedMap.ValueIterator An iterator on values.IntSet An unordered set where the items are unboxed ints.IntSet.IntSetIterator IntVLA A resizable, ordered or unordered variable-length int array.IPointHash An interface for "point hashes", that is, functions that produce usually-unique integer results given multiple integer inputs.IPointHash.IntImpl A convenience abstract class to implement IPointHash when you have an int for state.IPointHash.LongImpl A convenience abstract class to implement IPointHash when you have a long for state.IRNG Interface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource
).IsaacRNG This is a port of the public domain Isaac64 (cryptographic) random number generator to Java.IStatefulRNG Simply groups the two interfacesIRNG
andStatefulRandomness
so some implementations of IRNG can have their states read from and written to.JitterNoise "Classic Perlin" noise with jitter applied to the grid it operates on.K2 An ordered bidirectional map-like data structure, with unique A keys and unique B keys updated together like a map that can be queried by A keys, B keys, or int indices.K2V1 An ordered multi-directional map-like data structure with two sets of keys and one list of values.Lathe32RNG A modification of Blackman and Vigna's xoroshiro128+ generator using two 32-bit ints of state instead of two 64-bit longs, as well as modifying the output with two additional operations on the existing state; this is both the fastest generator on GWT I have found without statistical failures, and a StatefulRandomness.LFSR A Linear Feedback Shift Register that may be used like a StatefulRandomness but is not truly random.LightRNG This is a SplittableRandom-style generator, meant to have a tiny state that permits storing many different generators with low overhead.LinnormRNG A mid-high-quality StatefulRandomness that is the second-fastest 64-bit generator in this library that is 1-dimensionally equidistributed across its 64-bit outputs.LongPeriodRNG An RNG that has a drastically longer period than the other generators in SquidLib, other thanIsaacRNG
, without sacrificing speed or GWT support.LowStorageShuffler Gets a sequence of distinct pseudo-random ints (typically used as indices) from 0 to some bound, without storing all of the sequence in memory.MasonNoise Noise functions that delegate work to the best-suited noise type for the requested dimensionality, plus some extra functions that affect a large multi-dimensional area at once.MerlinNoise Really strange noise functions that typically produce curving black and white shapes when rendered.MersenneTwister Mersenne Twister, 64-bit version as a RandomnessSource.MiniMover64RNG The fastest generator in this library on desktop JVMs; one of Mark Overton's subcycle generators from this article, specifically a CMR with a 64-bit state, that has its result multiplied by a constant.MitchellNoise.Vec4 MizuchiRNG A high-quality StatefulRandomness based onLinnormRNG
but modified to allow any odd number as a stream, instead of LinnormRNG's hardcoded stream of 1.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 staticMoonwalkRNG.inverseNextLong(long)
method, and distance checks between two generated numbers with the staticMoonwalkRNG.distance(long, long)
method.Mover32RNG One of Mark Overton's subcycle generators from this article, specifically a cmr^cmr with two 32-bit states; this is the fastest 32-bit generator that still passes statistical tests, plus it's optimized for GWT (sometimes).Mover64RNG One of Mark Overton's subcycle generators from this article, specifically a cmr^cmr with two 64-bit states.NLFSR A Non-Linear Feedback Shift Register that may be used like a StatefulRandomness but is not truly random.Noise.Basic1D A very simple 1D noise implementation, because a full-blown Perlin or Simplex noise implementation is probably overkill for 1D noise.Noise.Noise1D Noise.Noise2D Noise.Noise3D Noise.Noise4D Noise.Noise6D Noise.Sway1D Noise.Sway2D OrbitRNG A variant onThrustAltRNG
that gives up some speed to gain a much better period and the ability to produce all possible long values over that period.OrderedMap A generic insertion-ordered hash map with with a fast implementation, originally from fastutil as Object2ObjectLinkedOpenHashMap but modified to support constant-time indexed access of keys, values, and entries, reordering, and optional hash strategies for unusual keys, such as arrays or usually-dense numeric values.OrderedMap.KeyIterator An iterator on keys.OrderedMap.KeySet OrderedMap.MapEntrySet OrderedMap.ValueIterator An iterator on values.OrderedSet A generic linked hash set with with a fast implementation, originally from fastutil as ObjectLinkedOpenHashSet but modified to support indexed access of items, reordering, and optional hash strategies for array keys (which fastutil does differently).Oriole32RNG A modification of Blackman and Vigna's xoroshiro128+ generator using two 32-bit ints of state instead of two 64-bit longs and also incorporating a large-increment counter (Weyl sequence) that is added to the rotated xoroshiro output; this is tied withLathe32RNG
for the fastest generator on GWT I have found that also passes the full 32TB battery of PractRand's statistical tests.PermutedRNG This is a RandomnessSource in the PCG-Random family.PhantomNoise Arbitrary-dimensional continuous noise that maintains most of the same style even as the dimensionality gets fairly high.PintRNG A RandomnessSource based on PCG-Random that has a single int of state.ProbabilityTable A generic method of holding a probability table to determine weighted random outcomes.PulleyRNG A very-high-quality StatefulRandomness that is meant to be reasonably fast, but also to be robust against frequent state changes, and is built around a strong determine() method.RandomBias A class that wraps an RNG and allows different String keys to be associated with biases toward low or high results when a method is called that gets a number from the wrapped RNG.RandomnessSource This interface defines the interactions required of a random number generator.Region NOTE: You should considerGreasedRegion
before using this class, unless you know Region does exactly what you want.RNG A wrapper class for working with random number generators in a more friendly way.SeededNoise More advanced noise functions, in 2D, 3D, 4D, and 6D, with the last two as options for generating seamlessly-tiling noise usingNoise.seamless2D(double[][], long, int, Noise.Noise4D)
and/orNoise.seamless3D(double[][][], long, int, Noise.Noise6D)
.ShortVLA A resizable, ordered or unordered short variable-length array.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 likeGWTRNG
but should perform better on recent desktop JVMs.SkippingRandomness A simple interface for RandomnessSources that have the additional capability to skip forward or backward in their generated number stream.SobolQRNG Implementation of a Sobol sequence as a Quasi-Random Number Generator.SpikeDistribution An IDistribution that produces results between -1.0 inclusive and 1.0 exclusive, but is much more likely to produce results near 0.0, and does not "round off" like a Gaussian curve around the midpoint.SquidID A UUID-like identifier; not compatible with Java's standard UUID but will work on GWT.Starfish32RNG A modification of Blackman and Vigna's xoroshiro64** generator; uses two 32-bit ints of state likeLathe32RNG
but has better equidistribution.StatefulRandomness A simple interface for RandomnessSources that have the additional property of a state that can be re-set.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().TangleRNG A very fast generator on 64-bit systems that allows choosing any of 2 to the 63 odd-number streams.ThrustAltRNG A random number generator that is extremely fast but can't return all possible results.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.UnorderedMap A generic unordered hash map; generally preferHashMap
unless you need array keys.ValueNoise A low-quality continuous noise generator with strong grid artifacts, this is nonetheless useful as a building block.VanDerCorputQRNG A quasi-random number generator that goes through one of many sub-random sequences found by J.G.Voronoi.Edge Voronoi.Polygon Voronoi.Triangle WeightedTable A different approach to the same taskProbabilityTable
solves, though this only looks up an appropriate index instead of also storing items it can choose; allows positive doubles for weights but does not allow nested tables for simplicity.WhirlingNoise A Noise class that's here for compatibility; it extendsSeededNoise
and delegates to it for all methods exceptWhirlingNoise.noiseAlt(double, double)
andWhirlingNoise.noiseAlt(double, double, double)
.WhiteNoise Performance-oriented white noise generator for 1D, 2D, 3D, 4D, and 6D.XoRoRNG A port of Blackman and Vigna's xoroshiro128+ generator; should be very fast and produce medium-quality output.XoshiroStarPhi32RNG A modification of Blackman and Vigna's xoshiro128 generator with a different "scrambler" than the default; this generator has four 32-bit states and passes at least 32TB of PractRand (with one "unusual" anomaly at 4TB).