classpublicfinalPriority 3
RandomExtra
com.hypixel.hytale.math.random.RandomExtra
22
Methods
22
Public Methods
0
Fields
1
Constructors
Constructors
private
RandomExtra()Methods
Public Methods (22)
publicstatic
Vector3d jitter(Vector3d vec, double maxRange)@Nonnull
publicstatic
int pickWeightedIndex(double[] weights)publicstatic
double randomBinomial()publicstatic
boolean randomBoolean()publicstatic
Duration randomDuration(Duration from, Duration to)publicstatic
<T> T randomElement(List<T> collection)publicstatic
<T> T randomIntWeightedElement(Collection<? extends T> elements, ToIntFunction<T> weight)@Nullable
publicstatic
<T> T randomIntWeightedElement(Collection<? extends T> elements, ToIntFunction<T> weight, int sumWeights)@Nullable
publicstatic
double randomRange(double[] range)publicstatic
double randomRange(double from, double to)publicstatic
float randomRange(float[] range)publicstatic
float randomRange(float from, float to)publicstatic
int randomRange(int bound)publicstatic
int randomRange(int[] range)publicstatic
int randomRange(int from, int to)publicstatic
long randomRange(long from, long to)publicstatic
<T> T randomWeightedElement(Collection<? extends T> elements, ToDoubleFunction<T> weight)@Nullable
publicstatic
<T> T randomWeightedElement(Collection<? extends T> elements, ToDoubleFunction<T> weight, double sumWeights)@Nullable
publicstatic
<T> T randomWeightedElement(Collection<? extends T> elements, Predicate<T> filter, ToDoubleFunction<T> weight)@Nullable
publicstatic
<T> T randomWeightedElementFiltered(Collection<? extends T> elements, Predicate<T> filter, ToIntFunction<T> weight)@Nullable
publicstatic
<T> void reservoirSample(List<T> input, Predicate<T> matcher, int count, List<T> picked)publicstatic
<E, T extends List<E>> void reservoirSample(E element, int count, T picked)Related Classes
Used By