Stochastic rule

In analogous manner to conditional rules, the CGA Shape grammar permits stochastic rules, i.e. creating variation using randomness.

PredecessorShape --> 
                     percentage% : Successor1 
                     percentage% : Successor2
                     ...
                     else : SuccessorN

The sum of all percentages must not be greater than 100.

Example 1

Lot -->
	30%  : Lot("residential")
	20%  : Lot("retail")
	else : Lot("industrial")

In this example, there is a 30% chance the first successor is chosen and a new Lot shape with parameter "residential" is generated, a 20% chance for the second successor and a 50% chance for the last successor to be chosen.

All random numbers and also the choice of the percentages above, depend on the current shape's seed (the seedian shape attribute).

Example 2

Again, condition blocks can be nested:

Lot -->
	30%  : 
	              50%  : Lot("residential")
	              else : NIL 
	20%  : Lot("retail")
	else : Lot("industrial")

Note:

A condition block always needs to be finished with an else: statement and percentages and successors must not be mixed up.


In this topic