gshute.geom
Class LineGenerator

java.lang.Object
  |
  +--gshute.geom.LineGenerator

public class LineGenerator
extends java.lang.Object

Objects of class LineGenerator generate random horizontal and vertical lines within the unit rectangle in the plane.


Field Summary
protected  int count
          count is the number of lines in this line generator.
protected  double expectedIntersections
          expectedIntersections determines the expected number of intersections in lineSet.
protected  java.util.Set lineSet
          lineSet is the current set of lines for this line set generator.
protected  double multiplier
          lines generated by this LineGenerator have their length scaled by multiplier to control the expected number of intersections in lineSet.
protected  java.util.Random rand
          rand is the random number generator for this LIneGenerator.
protected  long seed
          seed is the seed for rand.
 
Constructor Summary
LineGenerator()
          new LineGenerator() returns a new LineGenerator.
 
Method Summary
protected  void generateLines()
          generateLines() generates count random normalized horizontal and vertical lines within the bounding rectangle of lg and records them in lineSet.
 int getCount()
          lg.getCount() returns the number of lines in lg.
 double getExpectedIntersections()
          lg.getExpectedIntersections() returns the expected number of intersections in the lines of lg.
 java.util.Set getLines()
          lg.getLines() returns the set of lines in lg.
 long getSeed()
          lg.getSeed() returns the random number generator seed of lg.
protected  java.awt.geom.Line2D newHorizontalLine()
          newHorizontalLine() returns a new horizontal Line.
protected  java.awt.geom.Line2D newVerticalLine()
          newVerticalLine() returns a new vertical Line.
 void setCount(int n)
          lg.setCount(n) sets the number of lines in lg to n.
 void setExpectedIntersections(double e)
          lg.setExpectedIntersections(e) sets the expected number of intersections in the lines generated by lg.
 void setSeed(long s)
          lg.setSeed(s) sets the seed of the random number generator of lg to s.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

seed

protected long seed
seed is the seed for rand.

rand

protected java.util.Random rand
rand is the random number generator for this LIneGenerator.

multiplier

protected double multiplier
lines generated by this LineGenerator have their length scaled by multiplier to control the expected number of intersections in lineSet.

expectedIntersections

protected double expectedIntersections
expectedIntersections determines the expected number of intersections in lineSet.

count

protected int count
count is the number of lines in this line generator.

lineSet

protected java.util.Set lineSet
lineSet is the current set of lines for this line set generator.
Constructor Detail

LineGenerator

public LineGenerator()
new LineGenerator() returns a new LineGenerator. Initially, the line count is 50, the expected number of intersections is 10.0, and the random number generator seed is set from the system clock.
Method Detail

getSeed

public long getSeed()
lg.getSeed() returns the random number generator seed of lg.

getCount

public int getCount()
lg.getCount() returns the number of lines in lg.

getExpectedIntersections

public double getExpectedIntersections()
lg.getExpectedIntersections() returns the expected number of intersections in the lines of lg.

getLines

public java.util.Set getLines()
lg.getLines() returns the set of lines in lg.

setSeed

public void setSeed(long s)
lg.setSeed(s) sets the seed of the random number generator of lg to s.

setExpectedIntersections

public void setExpectedIntersections(double e)
lg.setExpectedIntersections(e) sets the expected number of intersections in the lines generated by lg.

setCount

public void setCount(int n)
lg.setCount(n) sets the number of lines in lg to n.

newHorizontalLine

protected java.awt.geom.Line2D newHorizontalLine()
newHorizontalLine() returns a new horizontal Line.

newVerticalLine

protected java.awt.geom.Line2D newVerticalLine()
newVerticalLine() returns a new vertical Line.

generateLines

protected void generateLines()
generateLines() generates count random normalized horizontal and vertical lines within the bounding rectangle of lg and records them in lineSet.