Uses of Interface
squidpony.squidmath.RandomnessSource
| Package | Description |
|---|---|
| squidpony.squidmath |
A very broad package containing random number generators, geometry tools, data structures, and noise functions.
|
-
Uses of RandomnessSource in squidpony.squidmath
Subinterfaces of RandomnessSource in squidpony.squidmath Modifier and Type Interface Description interfaceFlawedRandomnessAn interface to indicate aRandomnessSourcethat is intentionally flawed to create output patterns where a truly random sequence would have none.interfaceIRNGInterface for full-featured random number generators to implement (it does more than, and includes all of,RandomnessSource).interfaceIStatefulRNGSimply groups the two interfacesIRNGandStatefulRandomnessso some implementations of IRNG can have their states read from and written to.interfaceSkippingRandomnessA simple interface for RandomnessSources that have the additional capability to skip forward or backward in their generated number stream.interfaceStatefulRandomnessA simple interface for RandomnessSources that have the additional property of a state that can be re-set.Classes in squidpony.squidmath that implement RandomnessSource Modifier and Type Class Description classAbstractRNGA helper class for implementingIRNGwithout so much busy-work.classBasicRandom32A 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.classBasicRandom64A 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.classChaosRNGAn RNG that cannot be seeded and should be fairly hard to predict what it will return next.classCriticalRNGA type of RNG that can generate values larger or smaller than the normal maximum or minimum, based on a modifier.classDeckRNGAn RNG variant that has 16 possible grades of value it can produce and shuffles them like a deck of cards.classDharmaRNGAn alteration to a RandomnessSource that attempts to produce values that are perceived as fair to an imperfect user.classDistributedRNGAn implementation ofIRNGthat allows specifying a distribution for all random numbers it produces via aIDistribution.SimpleDistributionvalue.classDiverRNGA 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.classEditRNGA subclass of StatefulRNG (and thus RNG) that allows customizing many parts of the random number generation.static classFlawedRandomness.AddRotateA flawed randomness source that adds a rotation of its state, to its state, every generation.static classFlawedRandomness.BigCounterA flawed randomness source that depends almost entirely on its starting state for any random-seeming results in its output.classGearRNGA 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.classGoatRNGA larger-period generator with 128 bits of state, good speed, and high quality in PractRand testing; it is at least 1-dimensionally equidistributed.classGWTRNGAn 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.classIsaacRNGThis is a port of the public domain Isaac64 (cryptographic) random number generator to Java.classLathe32RNGA 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.classLFSRA Linear Feedback Shift Register that may be used like a StatefulRandomness but is not truly random.classLightRNGThis is a SplittableRandom-style generator, meant to have a tiny state that permits storing many different generators with low overhead.classLinnormRNGA 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.classLongPeriodRNGAn RNG that has a drastically longer period than the other generators in SquidLib, other thanIsaacRNG, without sacrificing speed or GWT support.classMersenneTwisterMersenne Twister, 64-bit version as a RandomnessSource.classMiniMover64RNGThe 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.classMizuchiRNGA high-quality StatefulRandomness based onLinnormRNGbut modified to allow any odd number as a stream, instead of LinnormRNG's hardcoded stream of 1.classMoonwalkRNGAn 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.classMover32RNGOne 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).classMover64RNGOne of Mark Overton's subcycle generators from this article, specifically a cmr^cmr with two 64-bit states.classNLFSRA Non-Linear Feedback Shift Register that may be used like a StatefulRandomness but is not truly random.classOrbitRNGA variant onThrustAltRNGthat gives up some speed to gain a much better period and the ability to produce all possible long values over that period.classOriole32RNGA 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 withLathe32RNGfor the fastest generator on GWT I have found that also passes the full 32TB battery of PractRand's statistical tests.classPermutedRNGThis is a RandomnessSource in the PCG-Random family.classPintRNGA RandomnessSource based on PCG-Random that has a single int of state.classPulleyRNGA 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.classRNGA wrapper class for working with random number generators in a more friendly way.classSilkRNGAn 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 likeGWTRNGbut should perform better on recent desktop JVMs.classSobolQRNGImplementation of a Sobol sequence as a Quasi-Random Number Generator.classStarfish32RNGA modification of Blackman and Vigna's xoroshiro64** generator; uses two 32-bit ints of state likeLathe32RNGbut has better equidistribution.classStatefulRNGA slight variant on RNG that always uses a stateful RandomessSource and so can have its state set or retrieved using setState() or getState().classTangleRNGA very fast generator on 64-bit systems that allows choosing any of 2 to the 63 odd-number streams.classThrustAltRNGA random number generator that is extremely fast but can't return all possible results.classTweakRNGSomewhat 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.classVanDerCorputQRNGA quasi-random number generator that goes through one of many sub-random sequences found by J.G.classXoRoRNGA port of Blackman and Vigna's xoroshiro128+ generator; should be very fast and produce medium-quality output.classXoshiroStarPhi32RNGA 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).Fields in squidpony.squidmath declared as RandomnessSource Modifier and Type Field Description protected RandomnessSourceRNG. randomMethods in squidpony.squidmath that return RandomnessSource Modifier and Type Method Description RandomnessSourceRandomnessSource. copy()Produces a copy of this RandomnessSource that, if next() and/or nextLong() are called on this object and the copy, both will generate the same sequence of random numbers from the point copy() was called.RandomnessSourceStatefulRandomness. copy()Produces a copy of this StatefulRandomness that, if next() and/or nextLong() are called on this object and the copy, both will generate the same sequence of random numbers from the point copy() was called.RandomnessSourceDeckRNG. getRandomness()RandomnessSourceDharmaRNG. getRandomness()RandomnessSourceEditRNG. getRandomness()RandomnessSourceRNG. getRandomness()Methods in squidpony.squidmath with parameters of type RandomnessSource Modifier and Type Method Description static longGreasedRegion. approximateBits(RandomnessSource random, int bitCount)Generates a random 64-bit long with a number of '1' bits (Hamming weight) equal on average to bitCount.GreasedRegionGreasedRegion. deteriorate(RandomnessSource random, double preservation)Randomly removes points from a GreasedRegion, with preservation as a fraction between 1.0 (keep all) and 0.0 (remove all).GreasedRegionGreasedRegion. deteriorate(RandomnessSource rng, int preservation)Randomly removes points from a GreasedRegion, with larger values for preservation keeping more of the existing shape intact.GreasedRegionGreasedRegion. disperseRandom(RandomnessSource random)Removes "on" cells that are nearby other "on" cells, with a random factor to which bits are actually turned off that still ensures exactly half of the bits are kept as-is (the one exception is when height is an odd number, which makes the bottom row slightly random).static longGreasedRegion. randomInterleave(RandomnessSource random)Gets a somewhat-random long with exactly 32 bits set; in each pair of bits starting at bit 0 and bit 1, then bit 2 and bit 3, up to bit 62 and bit 3, one bit will be 1 and one bit will be 0 in each pair.GreasedRegionGreasedRegion. refill(RandomnessSource random, double fraction, int width, int height)Reassigns this GreasedRegion randomly, reusing the current data storage (without extra allocations) if this.width == width and this.height == height, while trying to set the given fraction of cells to on.GreasedRegionGreasedRegion. refill(RandomnessSource 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.voidDeckRNG. setRandomness(RandomnessSource random)Reseeds this DeckRNG using the RandomnessSource it is given.voidDharmaRNG. setRandomness(RandomnessSource random)voidEditRNG. setRandomness(RandomnessSource random)voidRNG. setRandomness(RandomnessSource random)voidStatefulRNG. setRandomness(RandomnessSource random)Constructors in squidpony.squidmath with parameters of type RandomnessSource Constructor Description CriticalRNG(RandomnessSource random)Makes a CriticalRNG with a luck factor of 0 and the given RandomnessSource.CriticalRNG(RandomnessSource random, float luck)Makes a CriticalRNG with a luck factor of 0 and the given RandomnessSource.CustomRandom(RandomnessSource randomnessSource)Creates a new random number generator.DeckRNG(RandomnessSource random)Seeds this DeckRNG using the RandomnessSource it is given.DharmaRNG(RandomnessSource rs)Construct a new DharmaRNG with the given seed.DharmaRNG(RandomnessSource rs, double fairness)Construct a new DharmaRNG with the given seed.EditRNG(RandomnessSource rs)Construct a new EditRNG with the given seed.EditRNG(RandomnessSource rs, double expected)Construct a new EditRNG with the given seed.EditRNG(RandomnessSource rs, double expected, double centrality)Construct a new EditRNG with the given seed.GreasedRegion(RandomnessSource random, double fraction, int width, int height)Constructor for a random GreasedRegion of the given width and height, trying to set the given fraction of cells to on.GreasedRegion(RandomnessSource 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.ProbabilityTable(RandomnessSource rng)Creates a new probability table with the provided source of randomness used.RNG(RandomnessSource random)Uses the provided source of randomness for all calculations.StatefulRNG(RandomnessSource random)