SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Protected Attributes | List of all members
MarkovChainComparable Class Referenceabstract

A subclass of MarkovChain for which there is a total ordering between the states, induced by the implementation of the umontreal.ssj.util.MultiDimComparable interface. More...

Inheritance diagram for MarkovChainComparable:
[legend]
Collaboration diagram for MarkovChainComparable:
[legend]

Public Member Functions

int getStateDimension ()
 Returns the dimension of the state.
 
- Public Member Functions inherited from MarkovChain
abstract void initialState ()
 Sets the Markov chain to its (deterministic) initial state and initializes the collectors for the performance measure, ready to start a simulation. More...
 
abstract void nextStep (RandomStream stream)
 Simulates one more step of the chain, from its current state, using stream for the randomness. More...
 
abstract double getPerformance ()
 Returns the performance measure (total or average cost or gain) so far, for the current simulation run.
 
Object clone () throws CloneNotSupportedException
 Returns a clone of the chain.
 
boolean hasStopped ()
 Tells if the chain has stopped.
 
void simulSteps (int numSteps, RandomStream stream)
 Starts a new simulation run and simulates numSteps steps of the Markov chain or until the chain stops, using the given stream.
 
void simulSteps (RandomStream stream)
 Starts a new simulation run and simulates until the stopping time is reached, using the given stream. More...
 
void simulRuns (int n, int numSteps, RandomStream stream, Tally statRuns)
 Performs n simulation runs of the chain, for numSteps steps per run, using the given stream. More...
 
void simulRunsWithSubstreams (int n, int numSteps, RandomStream stream, Tally statRuns)
 Same as simulRuns, except that the stream is first reset to its initial seed and then reset to the first substream at the beginning and to the next substream after each run.
 
double simulMC (int n, int numSteps)
 Perform n simulation runs of the chain, each for numSteps steps, and returns average.
 
double simulMC (int n)
 Perform n runs, each one until the chain stops.
 
void simulRepMC (int n, int numSteps, int m, Tally t)
 Perform n runs and compute the average, reapeat m times and return the stats in t.
 
void simulRepMC (int n, int m, Tally t)
 Same as previous one, but run the chains until they stop.
 
void simulRQMC (PointSet p, int m, int numSteps, PointSetRandomization rand, Tally statReps)
 Performs m independent replicates of \(n\) simulation runs of the chain using a RQMC point set, each time storing the average of the performance over the \(n\) chains. More...
 
String simulRunsFormat (int n, int numSteps, RandomStream stream, Tally statRuns)
 Same as simulRuns but also returns the results as a formatted string.
 
String simulRunsWithSubstreamsFormat (int n, int numSteps, RandomStream stream, Tally statRuns)
 Same as simulRunsWithSubstreams but also returns the results as a formatted string.
 
String simulRQMCFormat (PointSet p, int m, int numSteps, PointSetRandomization rand, Tally statReps)
 Same as simulRQMC but also returns the results as a formatted string.
 
String testImprovementRQMCFormat (PointSet p, int m, int numSteps, PointSetRandomization rand, double varMC, Tally statReps)
 Similar to simulRQMCFormat, but also gives the variance improvement factor with respect to MC. More...
 
String formatResults (Tally stat)
 Returns a string containing the mean, the variance, and a 90% confidence interval for stat.
 
String formatResultsRQMC (Tally stat, int numPoints)
 Returns a string containing the mean, the variance multiplied by numPoints, and a 90% confidence interval for stat.
 
- Public Member Functions inherited from MultiDimComparable< T >
int compareTo (T other, int j)
 Similar to compareTo in the class Comparable, except that one specifies the index \(j\) of the criterion on which the objects are to be compared. More...
 

Protected Attributes

int stateDim
 
- Protected Attributes inherited from MarkovChain
boolean stopped = false
 

Additional Inherited Members

- Package Attributes inherited from MarkovChain
Chrono timer = Chrono.createForSingleThread()
 
int numSteps
 

Detailed Description

A subclass of MarkovChain for which there is a total ordering between the states, induced by the implementation of the umontreal.ssj.util.MultiDimComparable interface.

A list or array of MarkovChainComparable objects can be sorted according to their states at a given step, using a umontreal.ssj.util.MultiDimComparator and an external sorting method.

The method compareTo(MarkovChainComparable m, int i) must return a negative integer, zero, or a positive integer, and this Markov chain is considered smaller than, equal to, or greater than the other chain m in dimension i. The meaning of smaller, equal or larger is very flexible as well as the meaning of dimension.

Concrete subclasses must implement compareTo and must initialize the variable stateDim in the constructor to the value of the state dimension. It can be understood as the largest integer j for which the method compareTo(m,j) can be called. They must also implement abstract methods of MarkovChain.


The documentation for this class was generated from the following file: