An introduction to computer simulation