java.lang.Object
org.pokersource.enum.NestedLoopSampling
- All Implemented Interfaces:
- java.util.Enumeration
- public class NestedLoopSampling
- extends java.lang.Object
- implements java.util.Enumeration
Like NestedLoopEnumeration, but rather than visiting every entry in
turn, randomly samples with replacement.
Constructor Summary |
NestedLoopSampling(int[] limits,
int nsamples)
Initializes a nested loop sampler with limits.length dimensions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
nsamples
private int nsamples
elem
private int[] elem
limits
private int[] limits
rand
private java.util.Random rand
NestedLoopSampling
public NestedLoopSampling(int[] limits,
int nsamples)
- Initializes a nested loop sampler with limits.length dimensions.
hasMoreElements
public boolean hasMoreElements()
- Description copied from interface:
java.util.Enumeration
- Tests whether there are elements remaining in the enumeration.
- Specified by:
hasMoreElements
in interface java.util.Enumeration
nextElement
public java.lang.Object nextElement()
- Return an integer array sampling the next loop indices for each
dimension.
- Specified by:
nextElement
in interface java.util.Enumeration