Showing content from http://umontreal-simul.github.io/ssj/docs/master/classumontreal_1_1ssj_1_1simexp_1_1RepSim.html below:
SSJ: RepSim Class Reference
Performs a simulation experiment on a finite horizon, using a certain number of independent runs or replications. More...
RepSim (int minReps) Constructs a new replications-based simulator with a minimal number of runs, minReps
, and no maximal number of runs. More...
RepSim (int minReps, int maxReps) Constructs a new replications-based simulator with a minimal number of runs minReps
, and a maximal number of runs maxReps
. More...
RepSim (Simulator sim, int minReps) Equivalent to the first constructor, with the given simulator sim
. More...
RepSim (Simulator sim, int minReps, int maxReps) Equivalent to the second constructor, with the given simulator sim
. More...
int getMinReplications () Returns the minimal number of replications to be simulated before an error check. More...
void setMinReplications (int minReps) Sets the minimal number of replications required before an error check to minReps
. More...
int getMaxReplications () Returns the maximal number of replications to be simulated before an error check. More...
void setMaxReplications (int maxReps) Sets the maximal number of replications required before an error check to maxReps
. More...
int getTargetReplications () Returns the actual target number of replications to be simulated before an error check. More...
void setTargetReplications (int targetReps) Sets the target number of simulated replications before an error check to targetReps
. More...
int getCompletedReplications () Returns the total number of completed replications for the current experiment. More...
abstract void initReplicationProbes () Initializes any statistical collector used to collect values for replications.
void performReplication (int r) Contains the necessary logic to perform the r
th replication of the simulation. More...
abstract void initReplication (int r) Initializes the simulation model for a new replication r
. More...
abstract void addReplicationObs (int r) Adds statistical observations for the replication r
. More...
int getRequiredNewReplications () Returns the approximate number of additional replications to meet an experiment-specific stopping criterion. More...
void init () Initializes this simulator for a new experiment. More...
void adjustTargetReplications (int numNewReplications) Adjusts the target number of replications to simulate numNewReplications
additional replications. More...
void simulate () Simulates several independent simulation replications of a system. More...
String toString () final Simulator simulator () Returns the simulator linked to this experiment object. More...
final void setSimulator (Simulator sim) Sets the simulator associated with this experiment to sim
. More...
boolean isSimulating () Determines if the simulation is in progress. More...
abstract void simulate () Performs an experiment whose logic depends on the used subclass. More...
static int getRequiredNewObservations (StatProbe[] a, double targetError, double level) Returns the approximate number of additional observations required to reach a relative error smaller than or equal to targetError
for each tally in the array a
when confidence intervals are computed with confidence level level
. More...
static int getRequiredNewObservations (Iterable<? extends StatProbe > it, double targetError, double level) Returns the approximate number of additional observations required to reach a relative error smaller than or equal to targetError
for each tally enumerated by it
when confidence intervals are computed with confidence level level
. More...
static int getRequiredNewObservations (StatProbe probe, double targetError, double level) Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the statistical probe probe
. More...
static int getRequiredNewObservationsTally (Tally ta, double targetError, double level) Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the tally ta
. More...
static int getRequiredNewObservationsTally (FunctionOfMultipleMeansTally fmmt, double targetError, double level) Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the function of multiple means fmmt
. More...
static int getRequiredNewObservations (double center, double radius, int numberObs, double targetError) Returns the approximate number of additional observations needed for the point estimator \(\bar{X}_n=\) center
, computed using \(n=\) numberObs
observations and with a confidence interval having radius \(\delta_n/\sqrt{n}=\) radius
, to have a relative error less than or equal to \(\epsilon=\) targetError
. More...
Simulator sim boolean simulating = false Determines if the simulation is in progress.
Performs a simulation experiment on a finite horizon, using a certain number of independent runs or replications.
During each run \(r\), a complete simulation is executed, and the vector \(\mathbf{X}_r\) is generated. If simulation runs are independent, and the same system is simulated during each run, after \(n\) runs are performed, a sample \((\mathbf{X}_0, …, \mathbf{X}_{n-1})\) is obtained.
For such a simulation to be implemented, this class must be extended to override the required methods: initReplicationProbes to initialize the statistical probes collecting \(\mathbf{X}_r’s\), initReplication(int) to initialize the simulation model at the beginning of each replication, and addReplicationObs(int) to add \(\mathbf{X}_r\) to the statistical probes.
◆ RepSim() [1/4]
Constructs a new replications-based simulator with a minimal number of runs, minReps
, and no maximal number of runs.
-
Parameters
-
minReps the minimal number of replications.
-
Exceptions
-
IllegalArgumentException if the minimal number of replications is smaller than 0.
◆ RepSim() [2/4] RepSim ( int minReps, int maxReps )
Constructs a new replications-based simulator with a minimal number of runs minReps
, and a maximal number of runs maxReps
.
This maximum is used to avoid too long simulations when using sequential sampling.
-
Parameters
-
minReps the minimal number of replications. maxReps the maximal number of replications.
-
Exceptions
-
IllegalArgumentException if the minimal or maximal numbers of replications is smaller than 0, or if
minReps
is greater than maxReps
.
◆ RepSim() [3/4]
Equivalent to the first constructor, with the given simulator sim
.
-
Parameters
-
sim the simulator attached to this object. minReps the minimal number of replications.
-
Exceptions
-
IllegalArgumentException if the minimal number of replications is smaller than 0.
◆ RepSim() [4/4]
Equivalent to the second constructor, with the given simulator sim
.
-
Parameters
-
sim the simulator attached to this object. minReps the minimal number of replications. maxReps the maximal number of replications.
-
Exceptions
-
IllegalArgumentException if the minimal or maximal numbers of replications is smaller than 0, or if
minReps
is greater than maxReps
.
◆ addReplicationObs() abstract void addReplicationObs ( int r ) abstract
Adds statistical observations for the replication r
.
This method is called just after the replication r
is simulated.
-
Parameters
-
r the index of the replication.
◆ adjustTargetReplications() void adjustTargetReplications ( int numNewReplications )
Adjusts the target number of replications to simulate numNewReplications
additional replications.
This method increases the target number of replications by numNewReplications
, and sets the target number of replications to getMaxReplications if the new target exceeds the maximal number of replications. This is called by simulate for sequential sampling.
-
Parameters
-
numNewReplications the number of additionnal replications needed.
◆ getCompletedReplications() int getCompletedReplications ( )
Returns the total number of completed replications for the current experiment.
-
Returns
-
the number of completed replications.
◆ getMaxReplications() int getMaxReplications ( )
Returns the maximal number of replications to be simulated before an error check.
By default, this is set to java.lang.Integer.MAX_VALUE, which is equivalent to infinity in practice.
-
Returns
-
the maximal number of replications.
◆ getMinReplications() int getMinReplications ( )
Returns the minimal number of replications to be simulated before an error check.
-
Returns
-
the minimal number of replications.
◆ getRequiredNewReplications() int getRequiredNewReplications ( )
Returns the approximate number of additional replications to meet an experiment-specific stopping criterion.
This is called after getTargetReplications replications are simulated. Since sequential sampling is not used by default, the default implementation returns 0, which stops the simulation after getTargetReplications replications.
-
Returns
-
the number of required additional replications.
◆ getTargetReplications() int getTargetReplications ( )
Returns the actual target number of replications to be simulated before an error check.
By default, this is initialized to the minimal number of replications, and is increased if new replications are needed. However, it is not decreased by default, even upon a new call to simulate.
-
Returns
-
the target number of replications.
◆ init()
Initializes this simulator for a new experiment.
This method resets the number of completed replications to 0, and calls initReplicationProbes to initialize statistical probes. This method is called by simulate.
◆ initReplication() abstract void initReplication ( int r ) abstract
Initializes the simulation model for a new replication r
.
This method should reset any counter and model state, and schedule needed events. After the method returns, the model should be ready for calling umontreal.ssj.simevents.Sim.start. This method is called just after the simulator is initialized.
-
Parameters
-
r the index of the replication.
◆ performReplication() void performReplication ( int r ) ◆ replicationDone() ◆ setMaxReplications() void setMaxReplications ( int maxReps )
Sets the maximal number of replications required before an error check to maxReps
.
This will take effect only at the next call to simulate.
-
Parameters
-
maxReps the maximal number of replications.
-
Exceptions
-
IllegalArgumentException if the specified number of replications is negative.
◆ setMinReplications() void setMinReplications ( int minReps )
Sets the minimal number of replications required before an error check to minReps
.
This also updates the maximal number of replications if this maximum is smaller than the new minimum. This will take effect only at the next call to simulate.
-
Parameters
-
minReps the minimal number of replications.
-
Exceptions
-
IllegalArgumentException if the specified number of replications is negative.
◆ setTargetReplications() void setTargetReplications ( int targetReps )
Sets the target number of simulated replications before an error check to targetReps
.
The value of targetReps
must not be smaller than the minimal number of replications returned by getMinReplications, or greater than the maximal number of replications returned by getMaxReplications.
-
Parameters
-
targetReps the target number of replications.
-
Exceptions
-
IllegalArgumentException if the new target number of replications is smaller than the minimal number of replications.
◆ simulate()
The documentation for this class was generated from the following file:
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4