Algorithm
Development Kit 1.0

algs.model.data.nd
Class UniformGenerator

java.lang.Object
  extended by algs.model.data.Generator<IMultiPoint>
      extended by algs.model.data.nd.UniformGenerator

public class UniformGenerator
extends Generator<IMultiPoint>

Generators of sample data points within the [0,scale) unit square.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Field Summary
 int dimensions
          Points are assigned this number of dimensions.
 double scale
          Points are drawn with indices in range [0,scale].
 
Constructor Summary
UniformGenerator(int dimensions, double scale)
          Construct generator given desired number of dimensions and scale.
 
Method Summary
 Generator<IMultiPoint> construct(java.lang.String[] args)
          Provide reflective behavior to construct instance of generator given an array of string arguments.
 IMultiPoint[] generate(int size)
          Generate a set of uniform random points in the range:
 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

dimensions

public final int dimensions
Points are assigned this number of dimensions.


scale

public final double scale
Points are drawn with indices in range [0,scale].

Constructor Detail

UniformGenerator

public UniformGenerator(int dimensions,
                        double scale)
Construct generator given desired number of dimensions and scale.

Parameters:
dimensions -
scale -
Method Detail

parameters

public java.lang.String[] parameters()
Description copied from class: Generator
Declares the name of the parameters used when constructing the generator in order from left to right.

Specified by:
parameters in class Generator<IMultiPoint>

construct

public Generator<IMultiPoint> construct(java.lang.String[] args)
Provide reflective behavior to construct instance of generator given an array of string arguments.

Specified by:
construct in class Generator<IMultiPoint>

generate

public IMultiPoint[] generate(int size)
Generate a set of uniform random points in the range:

Specified by:
generate in class Generator<IMultiPoint>
Parameters:
size - number of points to generate.

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.