SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
QMCSampler.java
1package umontreal.ssj.mcqmctools.anova;
2
3import umontreal.ssj.stat.Tally;
4import umontreal.ssj.hups.*;
5import umontreal.ssj.mcqmctools.*;
6
13public class QMCSampler implements Sampler {
14
15 protected PointSet points;
16
17 public QMCSampler(PointSet points) {
18 this.points = points;
19 }
20
21 public PointSet getPointSet() {
22 return points;
23 }
24
27 return 1;
28 }
29
31 public int getNumSamples() {
32 return points.getNumPoints();
33 }
34
40
41 for (PointSetIterator it = points.iterator(); it.hasNextPoint(); it.resetToNextPoint()) {
42 model.simulate(it);
43 collector.observe(model.getPerformance());
44 }
45 }
46
51 public void simulateRuns(MonteCarloModelDouble model, Tally collector) {
52 for (PointSetIterator it = points.iterator(); it.hasNextPoint(); it.resetToNextPoint()) {
53 model.simulate(it);
54 collector.add(model.getPerformance());
55 }
56 }
57
58 @Override
59 public String toString() {
60 return "QMC Sampler [nPoints=" + points.getNumPoints() + "]" + " [points=" + points.getClass().getSimpleName()
61 + "]";
62 }
63}
This abstract class represents a general point set.
Definition PointSet.java:99
int getNumPoints()
Returns the number of points.
int getNumSimulationsPerSample()
Returns the number of times the model is simulated each time a sample is produced.
void simulateRuns(MonteCarloModelDouble model, Tally collector)
int getNumSamples()
Returns the number of samples produced each time the simulateRuns() method is called.
public< E > void simulateRuns(MonteCarloModel<? extends E > model, ObservationCollector< E > collector)
A subclass of StatProbe.
Definition Tally.java:47
void add(double x)
Gives a new observation x to the statistical collector.
Definition Tally.java:109
This is the interface for iterators that permit one to go through the points of a PointSet and the su...
boolean hasNextPoint()
Returns true if there is a next point.
An interface for a very simple simulation model for which Monte Carlo (MC) and RQMC experiments are t...
void simulate(RandomStream stream)
Simulates the model for one run.
double getPerformance()
Recovers and returns the realization of the performance measure, of type double.
An interface for a simple simulation model for which Monte Carlo (MC) or RQMC experiments are to be p...
void simulate(RandomStream stream)
Simulates the model for one run, using the given stream.
E getPerformance()
Recovers and returns the realization of the performance measure, of type E.