Game Development Reference
In-Depth Information
In effect what the PiEstimator class is doing is computing the area of the circle. Monte
Carlo methods aren't limited to circles. They can be used to compute the area under (that is,
integrate) any function. The PiEstimator class represents a simplistic Monte Carlo simulation
in that the probability function was linear. The same technique could just as easily been applied
with a nonlinear (Gaussian, exponential, etc.) probability function.
Summary
In this chapter we took a brief foray into the world of probability and how it can be applied to
game programming. We discussed how probability can be used to determine the likelihood of
random events. We looked at probability functions, cumulative distribution functions, and
inverse cumulative distribution functions. We discussed a commonly known probability distri-
bution function known as the Gaussian distribution and briefly touched on some other probability
functions.
Some of the specific things we saw in this chapter include the following:
How the mean and standard deviation define the peak and width of a probability function
curve
How the inverse cumulative distribution function can be used to assign values to variables
based on a probability function curve
How Monte Carlo techniques can be used to simulate crowd behavior by allowing each
component of the crowd to act independently
How Monte Carlo methods can estimate complex mathematical functions such as eval-
uating the value of
π
References
1. M. Abramowitz and Stegun, I., Handbook of Mathematical Functions , Dover Publications, 1974.
2. Bourke, P., “Distributions,” http://astronomy.swin.edu.au/~pbourke/analysis/
distributions/ .
Search WWH ::




Custom Search