1package umontreal.ssj.mcqmctools.anova;
3import umontreal.ssj.rng.RandomStream;
4import umontreal.ssj.hups.PointSetIterator;
5import umontreal.ssj.stat.Tally;
6import umontreal.ssj.stat.list.ListOfTallies;
7import umontreal.ssj.mcqmctools.*;
9public class MonteCarloIntegrator
extends MonteCarloSampler implements
RandomIntegrator {
12 protected Tally statValue =
null;
15 public MonteCarloIntegrator(
int samples) {
19 public MonteCarloIntegrator(
int samples,
RandomStream stream) {
20 super(samples, stream);
40 for (
int i = 0; i < nSamples; i++) {
50 if (statValue ==
null)
51 this.statValue =
new Tally();
55 return statValue.average();
66 for (
int i = 0; i < nSamples; i++) {
67 model.simulate(stream);
68 statValue.add(model.getPerformance());
76 if (statValueList ==
null || statValueList.size() != values.length)
81 statValueList.average(values);
85 public String toString() {
86 String s =
"Monte Carlo Integrator [samples=" +
getNumSamples() +
"]";
88 s +=
" [stream=" +
getStream().getClass().getSimpleName() +
"]";
Represents a list of tally statistical collectors.
static ListOfTallies< Tally > createWithTally(int size)
This factory method constructs and returns a list of tallies with size instances of umontreal....
This is the interface for iterators that permit one to go through the points of a PointSet and the su...
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...