-
Notifications
You must be signed in to change notification settings - Fork 1
Non Deterministic Designs
Unless you fixed the probability in some way, you get a different result everytime you run these designs. The tree designs ( tree and tree4 ) and city, are good examples of such designs. Typically one named shape rule will be defined more than once, without any weighting two such shape rules would each have 0.5 probability of being run. Three such rules would have a probability of 0.333' of being run etc...
This happens because unless defined, each rule is given a default weighting of 1, so for two rules the cummulative weighting is 2, therefore each has probability of a 1 / 2. However say we gave one rule a weighting of 0.1 as below, then the cummulative weighting would be 1.1.
shape :block, 0.1 do
and we would have two different probabilitities 0.1 / 1.1 and 1 / 1.1. An alternative way of adding non-deterministice behaviour is to use of ruby rand ( directly ) to set a color or shape parameter.