Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've taken an interest in writing life-based simulations in C. I've been trying to find resources online and books, but haven't found anything.

Is there a book out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on simulation programming? What about that book makes it special?

share|improve this question

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

closed as off-topic by MichaelT, Robert Harvey, Kilian Foth, gnat, Bart van Ingen Schenau Jul 10 '14 at 18:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – MichaelT, Robert Harvey, Kilian Foth, gnat, Bart van Ingen Schenau
If this question can be reworded to fit the rules in the help center, please edit the question.

This is probably too broad. Each of those simulations could be a question of its own. –  Anna Lear Jan 11 '12 at 2:05
Anna, I edited the post to focus on the one that I'm currently interested in. –  KerxPhilo Jan 11 '12 at 2:07
Hi KerxPhilo, I've revised your question to focus on something specific: asking for keywords and resources is way too broad to be a fit for the Stack Exchange model of Q&A. –  user8 Jan 11 '12 at 3:31
Anna and Mark, thank you for not closing this question and helping me revise it properly. –  KerxPhilo Jan 12 '12 at 2:27

1 Answer 1

If you're talking about simulation programming, one important aspect/type is Monte Carlo simulation. Essentially the idea is to randomly generate (many!) several runs of simulation data, then average the runs to get an overall simulation result. The averaging removes any randomness in the data and provides a clearer true result. Statistically, you're generating sample data and reducing the variance by using a large number of samples. This has become computationally more straightforward as processors have become faster and memory more plentiful. Also, this kind of simulation applies to modelling a large class of phenomena so getting to know some Monte Carlo approaches and ideas is a major tool for any simulation work.

The main issues come down to 1) correct modelling assumptions, 2) generating correct, efficient random values and 3) numerically stable algorithms (eg avoiding floating point arithmetic errors). Issue 1) is easily the most important (see Garbage In, Garbage Out) and require specific domain knowledge. Issues 2) and 3) are also important: knowing good algorithms for producing uniformly random variables is crucial, and there many pitfalls to avoid.

In light of this, one classic book of Monte Carlo methods is Monte Carlo Methods in Finance. Don't be put off by the "finance" in the title; the methods apply to a wide range of applications (helped me with population dynamics in biological modelling, for example). The book covers random variable generation and efficiency issues since in general generating random numbers is computationally expensive.

You can also see this free book on random variate generation.

share|improve this answer
thank you very much. This has already led me to lots of interesting resources. –  KerxPhilo Jan 12 '12 at 2:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.