25package umontreal.ssj.rng;
28import java.util.ArrayList;
29import java.util.Collections;
30import umontreal.ssj.rng.RandomStream;
46 private List streams =
new ArrayList();
59 throw new NullPointerException();
60 if (streams.contains(stream))
75 return streams.remove(stream);
94 return Collections.unmodifiableList(streams);
102 for (
int s = 0; s < streams.size(); s++)
111 for (
int s = 0; s < streams.size(); s++)
120 for (
int s = 0; s < streams.size(); s++)
124 public String toString() {
125 StringBuffer sb =
new StringBuffer(getClass().getName());
127 sb.append(
"number of stored streams: ").append(streams.size());
129 return sb.toString();
Manages a list of random streams for more convenient synchronization.
List getStreams()
Returns an unmodifiable list containing all the random streams in this random stream manager.
void resetStartSubstream()
Forwards to the umontreal.ssj.rng.RandomStream.resetStartSubstream methods of all streams in the list...
void resetStartStream()
Forwards to the umontreal.ssj.rng.RandomStream.resetStartStream methods of all streams in the list.
RandomStream add(RandomStream stream)
Adds the given stream to the internal list of this random stream manager and returns the added stream...
void clear()
Removes all the streams from the internal list of this random stream manager.
void resetNextSubstream()
Forwards to the umontreal.ssj.rng.RandomStream.resetNextSubstream methods of all streams in the list.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...