Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
L-system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Variations== A number of elaborations on this basic L-system technique have been developed which can be used in conjunction with each other. Among these are [[stochastic grammar]]s, [[context sensitive grammar]]s, and parametric grammars. ===Stochastic grammars=== The grammar model we have discussed thus far has been deterministic—that is, given any symbol in the grammar's alphabet, there has been exactly one production rule, which is always chosen, and always performs the same conversion. One alternative is to specify more than one production rule for a symbol, giving each a [[probability]] of occurring. For example, in the grammar of Example 2, we could change the rule for rewriting "0" from: :0 → 1[0]0 to a probabilistic rule: :0 (0.5) → 1[0]0 :0 (0.5) → 0 Under this production, whenever a "0" is encountered during string rewriting, there would be a 50% chance it would behave as previously described, and a 50% chance it would not change during production. When a stochastic grammar is used in an [[evolution]]ary context, it is advisable to incorporate a [[random]] seed into the [[genotype]], so that the stochastic properties of the image remain constant between generations. ===Context sensitive grammars=== A context sensitive production rule looks not only at the symbol it is modifying, but the symbols on the string appearing before and after it. For instance, the production rule: :b < a > c → aa transforms "a" to "aa", but only if the "a" occurs between a "b" and a "c" in the input string: :…bac… As with stochastic productions, there are multiple productions to handle symbols in different contexts. If no production rule can be found for a given context, the identity production is assumed, and the symbol does not change on transformation. If context-sensitive and context-free productions both exist within the same grammar, the context-sensitive production is assumed to take precedence when it is applicable. ===Parametric grammars=== In a parametric grammar, each symbol in the alphabet has a parameter list associated with it. A symbol coupled with its parameter list is called a module, and a string in a parametric grammar is a series of modules. An example string might be: :a(0,1)[b(0,0)]a(1,2) The parameters can be used by the drawing functions, and also by the production rules. The production rules can use the parameters in two ways: first, in a conditional statement determining whether the rule will apply, and second, the production rule can modify the actual parameters. For example, look at: :a(x,y) : x == 0 → a(1, y+1)b(2,3) The module a(x,y) undergoes transformation under this production rule if the conditional x=0 is met. For example, a(0,2) would undergo transformation, and a(1,2) would not. In the transformation portion of the production rule, the parameters as well as entire modules can be affected. In the above example, the module b(x,y) is added to the string, with initial parameters (2,3). Also, the parameters of the already existing module are transformed. Under the above production rule, :a(0,2) Becomes :a(1,3)b(2,3) as the "x" parameter of a(x,y) is explicitly transformed to a "1" and the "y" parameter of a is incremented by one. Parametric grammars allow line lengths and branching angles to be determined by the grammar, rather than the turtle interpretation methods. Also, if age is given as a parameter for a module, rules can change depending on the age of a plant segment, allowing animations of the entire life-cycle of the tree to be created. ===Bi-directional grammars=== The bi-directional model explicitly separates the symbolic rewriting system from the shape assignment. For example, the string rewriting process in the Example 2 (Fractal tree) is independent on how graphical operations are assigned to the symbols. In other words, an infinite number of draw methods are applicable to a given rewriting system. The bi-directional model consists of 1) a forward process constructs the derivation tree with production rules, and 2) a backward process realizes the tree with shapes in a stepwise manner (from leaves to the root). Each inverse-derivation step involves essential geometric-topological reasoning. With this bi-directional framework, design constraints and objectives are encoded in the grammar-shape translation. In architectural design applications, the bi-directional grammar features consistent interior connectivity and a rich spatial hierarchy.<ref>Hua, H., 2017, December. [https://www.researchgate.net/profile/Hao_Hua/publication/311357805_A_Bi-Directional_Procedural_Model_for_Architectural_Design/links/5a29fb8baca2728e05dafa4b/A-Bi-Directional-Procedural-Model-for-Architectural-Design.pdf A Bi‐Directional Procedural Model for Architectural Design]. In Computer Graphics Forum (Vol. 36, No. 8, pp. 219-231).</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)