SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
RandomShift.java
1/*
2 * Class: RandomShift
3 * Description: Applies a random shift on a point set
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.hups;
26
27import umontreal.ssj.rng.RandomStream;
28
43public class RandomShift implements PointSetRandomization {
44
45 protected RandomStream stream;
46
52 public RandomShift() {
53 }
54
61 public RandomShift(RandomStream stream) {
62 this.stream = stream;
63 }
64
74 public void randomize(PointSet p) {
75 p.addRandomShift(stream);
76 }
77
83 public void setStream(RandomStream stream) {
84 this.stream = stream;
85 }
86
93 return stream;
94 }
95
99 public String toString() {
100 return "Random shift (digital if applied to a digital net)";
101 }
102
103}
This abstract class represents a general point set.
Definition PointSet.java:99
void addRandomShift(int d1, int d2, RandomStream stream)
By default, this method generates a random shift in the protected double[] array shift,...
void randomize(PointSet p)
This method calls addRandomShift(stream).
RandomShift(RandomStream stream)
Constructor that sets the internal umontreal.ssj.rng.RandomStream to stream.
String toString()
Returns a descriptor of this object.
RandomShift()
Empty constructor: No stream is passed here for the randomization; one must be passed later by setStr...
RandomStream getStream()
Returns the internal umontreal.ssj.rng.RandomStream.
void setStream(RandomStream stream)
Sets the internal umontreal.ssj.rng.RandomStream to stream.
This interface is for a randomization that can be used to randomize a umontreal.ssj....
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...