Class UniformGenerator

java.lang.Object
org.apache.sedona.common.spider.UniformGenerator
All Implemented Interfaces:
Iterator<org.locationtech.jts.geom.Geometry>, Generator

public class UniformGenerator extends Object
Generates geometries that are distributed uniformly
  • Field Summary

    Fields inherited from interface org.apache.sedona.common.spider.Generator

    GEOMETRY_FACTORY
  • Constructor Summary

    Constructors
    Constructor
    Description
    UniformGenerator(Random random, org.apache.sedona.common.spider.PointBasedGenerator.PointBasedParameter pointBasedParameter)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    bernoulli(double p)
    Generate a random value {0, 1} from a bernoulli distribution with parameter p
    protected int
    dice(int n)
    Generate a random integer in the range [1, n]
    protected int
    dice(int min, int max)
    Generate a random integer in the given range
    protected org.locationtech.jts.geom.Polygon
     
    protected org.locationtech.jts.geom.Coordinate
     
    protected org.locationtech.jts.geom.Point
     
    protected org.locationtech.jts.geom.Polygon
     
    boolean
     
    org.locationtech.jts.geom.Geometry
     
    protected double
    normal(double mu, double sigma)
    Generate a random number in the range (-inf, +inf) from a normal distribution
    protected double
    uniform(double a, double b)
    Generate a random value in the range [a, b) from a uniform distribution

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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()
      Specified by:
      hasNext in interface Iterator<org.locationtech.jts.geom.Geometry>
    • next

      public org.locationtech.jts.geom.Geometry next()
      Specified by:
      next in interface Iterator<org.locationtech.jts.geom.Geometry>
    • generatePoint

      protected org.locationtech.jts.geom.Point generatePoint()
    • generateBox

      protected org.locationtech.jts.geom.Polygon generateBox()
    • generatePolygon

      protected org.locationtech.jts.geom.Polygon generatePolygon()