All Packages Class Hierarchy This Package Previous Next Index
Class sim.data.OnesRnd
java.lang.Object
|
+----sim.data.Data
|
+----sim.data.OnesRnd
- public class OnesRnd
- extends Data
Generate an N-element vector, where the first K elements are 1.0,
and the rest of the elements are uniform, random in the range [0.0,1.0].
K is chosen uniformly from [0,N].
This code is (c) 1997 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 1.0, 21 May 97
- Author:
- Leemon Baird
-
OnesRnd()
-
-
BNF(int)
-
-
getData(double[], double[], Random)
- Put the input/output pair into arrays in/out.
-
getData(int, double[], double[])
- Put the nth input/output pair into arrays in/out.
-
parse(Parser, int)
- Parse the input file to get the parameters for this object.
-
setWatchManager(WatchManager, String)
- Remember the WatchManager for this object and create the window
-
unparse(Unparser, int)
- Output a description of this object that can be parsed with parse().
OnesRnd
public OnesRnd()
getData
public void getData(double in[],
double out[],
Random rnd)
- Put the input/output pair into arrays in/out.
The arrays must already have been initialized to the right sizes.
A randomly-chosen data point will be returned.
- Overrides:
- getData in class Data
getData
public void getData(int n,
double in[],
double out[])
- Put the nth input/output pair into arrays in/out.
The arrays must already have been initialized to the right sizes.
An exception is raised if n<0 or n>=nPairs.
If number of pairs is infinite, then exception is always thrown.
- Throws: ArrayIndexOutOfBoundsException
- arrays were too small or there is no "nth" data item
- Overrides:
- getData in class Data
BNF
public String BNF(int lang)
- Overrides:
- BNF in class Data
unparse
public void unparse(Unparser u,
int lang)
- Output a description of this object that can be parsed with parse().
- Overrides:
- unparse in class Data
- See Also:
- Parsable
parse
public Object parse(Parser p,
int lang) throws ParserException
- Parse the input file to get the parameters for this object.
- Throws: ParserException
- parser didn't find the required token
- Overrides:
- parse in class Data
setWatchManager
public void setWatchManager(WatchManager wm,
String name)
- Remember the WatchManager for this object and create the window
- Overrides:
- setWatchManager in class Data
All Packages Class Hierarchy This Package Previous Next Index