Package com.seedfinding.latticg
Class RandomReverser
- java.lang.Object
-
- com.seedfinding.latticg.RandomReverser
-
@Internal public class RandomReverser extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description RandomReverser(java.util.List<FilteredSkip> filteredSkips)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModConstraint(long min, long max, long newMod)
Add a constraint on the seed modulo something special.void
addNextBooleanCall(boolean value)
void
addNextDoubleCall(double min, double max)
Add a constraint that min <= nextDouble() < max.void
addNextDoubleCall(double min, double max, boolean minInclusive, boolean maxInclusive)
Add a constraint that min < / <= nextDouble() < / <= max, with strict inequalities when minInclusive or maxInclusive are false, respectively.void
addNextFloatCall(float min, float max)
Add a constraint that min <= nextFloat() < max.void
addNextFloatCall(float min, float max, boolean minInclusive, boolean maxInclusive)
Add a constraint that min < / <= nextFloat() < / <= max, with strict inequalities when minInclusive or maxInclusive are false, respectively.void
addNextIntCall(int min, int max)
void
addNextIntCall(int n, int min, int max)
void
addNextLongCall(long min, long max)
void
addUnmeasuredSeeds(long numSeeds)
void
consumeNextBooleanCalls(int numCalls)
void
consumeNextDoubleCalls(int numCalls)
void
consumeNextFloatCalls(int numCalls)
void
consumeNextIntCalls(int numCalls, int bound)
void
consumeNextLongCalls(int numCalls)
java.util.stream.LongStream
findAllValidSeeds()
void
setVerbose(boolean verbose)
-
-
-
Constructor Detail
-
RandomReverser
@Internal public RandomReverser(java.util.List<FilteredSkip> filteredSkips)
-
-
Method Detail
-
findAllValidSeeds
public java.util.stream.LongStream findAllValidSeeds()
-
addUnmeasuredSeeds
public void addUnmeasuredSeeds(long numSeeds)
-
addNextIntCall
public void addNextIntCall(int n, int min, int max)
-
addNextIntCall
public void addNextIntCall(int min, int max)
-
consumeNextIntCalls
public void consumeNextIntCalls(int numCalls, int bound)
-
addNextBooleanCall
public void addNextBooleanCall(boolean value)
-
consumeNextBooleanCalls
public void consumeNextBooleanCalls(int numCalls)
-
addNextFloatCall
public void addNextFloatCall(float min, float max, boolean minInclusive, boolean maxInclusive)
Add a constraint that min < / <= nextFloat() < / <= max, with strict inequalities when minInclusive or maxInclusive are false, respectively. As per the Java Random documentation min >= 0 and max < 1- Parameters:
min
- low end of the valid rangemax
- high end of the valid rangeminInclusive
- true if the low end of the valid range should be inclusivemaxInclusive
- true if the high end of the valid range should be inclusive
-
addNextFloatCall
public void addNextFloatCall(float min, float max)
Add a constraint that min <= nextFloat() < max.- Parameters:
min
- low end of the valid rangemax
- high end of the valid range
-
consumeNextFloatCalls
public void consumeNextFloatCalls(int numCalls)
-
addNextLongCall
public void addNextLongCall(long min, long max)
-
consumeNextLongCalls
public void consumeNextLongCalls(int numCalls)
-
addNextDoubleCall
public void addNextDoubleCall(double min, double max, boolean minInclusive, boolean maxInclusive)
Add a constraint that min < / <= nextDouble() < / <= max, with strict inequalities when minInclusive or maxInclusive are false, respectively.- Parameters:
min
- low end of the valid rangemax
- high end of the valid rangeminInclusive
- true if the low end of the valid range should be inclusivemaxInclusive
- true if the high end of the valid range should be inclusive
-
addNextDoubleCall
public void addNextDoubleCall(double min, double max)
Add a constraint that min <= nextDouble() < max.- Parameters:
min
- low end of the valid rangemax
- high end of the valid range
-
consumeNextDoubleCalls
public void consumeNextDoubleCalls(int numCalls)
-
addModConstraint
public void addModConstraint(long min, long max, long newMod)
Add a constraint on the seed modulo something special. There is no handling for specific java Random calls so to use this method requires investigating the implementation of the method one has periodic information on.- Parameters:
min
- low end, inclusive, of the valid range of seedsmax
- high end, inclusive, of the valid range of seedsnewMod
- the alternate modulus to use.
-
setVerbose
public void setVerbose(boolean verbose)
-
-