Package org.apache.sedona.common.spider
Class UniformGenerator
java.lang.Object
org.apache.sedona.common.spider.UniformGenerator
Generates geometries that are distributed uniformly
-
Field Summary
Fields inherited from interface org.apache.sedona.common.spider.Generator
GEOMETRY_FACTORY -
Constructor Summary
ConstructorsConstructorDescriptionUniformGenerator(Random random, org.apache.sedona.common.spider.PointBasedGenerator.PointBasedParameter pointBasedParameter) -
Method Summary
Modifier and TypeMethodDescriptionprotected intbernoulli(double p) Generate a random value {0, 1} from a bernoulli distribution with parameter pprotected intdice(int n) Generate a random integer in the range [1, n]protected intdice(int min, int max) Generate a random integer in the given rangeprotected org.locationtech.jts.geom.Polygonprotected org.locationtech.jts.geom.Coordinateprotected org.locationtech.jts.geom.Pointprotected org.locationtech.jts.geom.PolygonbooleanhasNext()org.locationtech.jts.geom.Geometrynext()protected doublenormal(double mu, double sigma) Generate a random number in the range (-inf, +inf) from a normal distributionprotected doubleuniform(double a, double b) Generate a random value in the range [a, b) from a uniform distributionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
UniformGenerator
public UniformGenerator(Random random, org.apache.sedona.common.spider.PointBasedGenerator.PointBasedParameter pointBasedParameter)
-
-
Method Details
-
generateCoordinate
protected org.locationtech.jts.geom.Coordinate generateCoordinate() -
bernoulli
protected int bernoulli(double p) Generate a random value {0, 1} from a bernoulli distribution with parameter p -
uniform
protected double uniform(double a, double b) Generate a random value in the range [a, b) from a uniform distribution -
normal
protected double normal(double mu, double sigma) Generate a random number in the range (-inf, +inf) from a normal distribution -
dice
protected int dice(int n) Generate a random integer in the range [1, n] -
dice
protected int dice(int min, int max) Generate a random integer in the given range -
hasNext
public boolean hasNext() -
next
public org.locationtech.jts.geom.Geometry next() -
generatePoint
protected org.locationtech.jts.geom.Point generatePoint() -
generateBox
protected org.locationtech.jts.geom.Polygon generateBox() -
generatePolygon
protected org.locationtech.jts.geom.Polygon generatePolygon()
-