|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.data.Generator<ILineSegment>
algs.model.data.segments.DoubleGenerator
public class DoubleGenerator
Generators of sample lines using doubles coordinated within the [max, max] box whose segment distance is length. Make sure we don't generate single points as line segments. To ensure points don't fall outside of the [max,max] range, we generate the internal random points using the smaller box [max-length].
Field Summary | |
---|---|
double |
length
The size of each line segment. |
double |
max
Size of the domain for both x- and y- coordinates [0, max]. |
Constructor Summary | |
---|---|
DoubleGenerator(double max,
double length)
Prepare generator with boundaries of the square together with the desired length of line segments to create. |
Method Summary | |
---|---|
Generator<ILineSegment> |
construct(java.lang.String[] args)
Provide reflective behavior to construct instance of generator given an array of string arguments. |
ILineSegment[] |
generate(int size)
Generate a random set of segments within a [max,max] box, extending potentially out to a larger range based upon the length of each line segment. |
java.lang.String[] |
parameters()
Declares the name of the parameters used when constructing the generator in order from left to right. |
Methods inherited from class algs.model.data.Generator |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final double length
public final double max
Constructor Detail |
---|
public DoubleGenerator(double max, double length)
max
- maximum square boundaries within which values are generatedlength
- length of the line.Method Detail |
---|
public java.lang.String[] parameters()
Generator
parameters
in class Generator<ILineSegment>
public Generator<ILineSegment> construct(java.lang.String[] args)
construct
in class Generator<ILineSegment>
public ILineSegment[] generate(int size)
generate
in class Generator<ILineSegment>
size
- The number of ILineSegments to create
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |