cforster / theme-park-project

An assignment about theme park queues
0 stars 11 forks source link

Threshold #35

Closed emiriamw closed 10 years ago

emiriamw commented 10 years ago

What is threshold in Customer on Line 40 in the tick function?

cforster commented 10 years ago

The threshold represents the choice that a customer makes.

Let's say the customer has a .6 threshold for a ride I pick a random number between 0.0 and 1.0. if my number is above threshold, i get on the ride otherwise, i do not, and i check a new ride.

This is a common design pattern for making a weighted random choice.