Take the 2-minute tour ×

I'm currently writing a process-oriented simulator using JavaSim for an university exam. The simulator itself is working nicely, but I have one major doubt: is there a correct/best way to find the steady state of the simulation in code?

The book I read vaguely describe the process of finding the "steady state" when the behavior of the simulation converges to a constant or repeating value:

Steady state

But how does this look in code? I think I could sample the statistics I need to gather at regular intervals and check whether they converge on a certain mean value or not. Or I could simply print out the values in time and arbitrarily decide when the simulation reaches a steady state?

share|improve this question
add comment

2 Answers

The standard approach is to monitor the rate of fluctuation, and pick some threshold small enough to be considered 'steady state'. Using a provided mean value is fragile because it hard-codes the absolute value of the solution you're looking for.

I would just calculate the standard deviation for a window of points, say the last 50, and declare the steady state reached when that deviation falls below an acceptable minimum (you do have to pick the minimum deviation yourself, because this is your definition of 'steady state'). This is roughly equivalent to accepting the answer when the wiggles in your graph become small enough for some sustained time.

share|improve this answer
add comment

Don't see that you ever got a good answer to this...

Check out online resources or Law and Kelton, Simulation Modeling and Analysis, for the process of determining steady state. The key is that you want your simulation to be independent of the system starting conditions. More to the point, the distribution of your key measures (like delay) should be independent of the starting conditions. They have a set of procedures to construct confidence intervals around your key measure based on the mean, variance, and sample size then to determine whether your consecutive samples are statistically the same. It's important to have a sufficient sample size though to satisfy the normality assumption.

Also good stuff in the book Simulation with Arena include a discussion of WHY steady state may not be important.

Good luck !

share|improve this answer
add comment

Your Answer


