What do we mean by context-sensitive? The context-sensitive L-system is
quite subtle. The major difference between the string generated by
a L-system and the geometry generated by the Turtle interpretation is that the
former is one-dimensional while the latter is a complicated three-dimensional
object. Is
it necessary to match all the patterns in space to find a specific rule?
It is not clear how to match context-sensitive L-systems
[&make_named_href('',
"node22.html#Prus90","[Prus90]"), page 32,]. The approach in this project is to ignore all nested
branches in the environment.
By implementing the stochastic L-system, we should choose a rule among
all the rules with the same predecessor according to the probabilities
assigned on them by the definition. We put all the probabilities of the
same set of rules into an array, and transfer the array into an accumulated
array. By generating a float random number from the Java system, we compare
it with the accumulated array and choose the rule with the highest probability.