JavaView® v2.00.008

vgp.tutor.lsystem
Class LSystem

java.lang.Object
  |
  +--vgp.tutor.lsystem.LSystem

public class LSystem
extends java.lang.Object

Generate a tree with a context-free L-system.

Version:
16.02.00, 1.00 revised (kp)
16.02.00, 1.00 created (kp)
Author:
Konrad Polthier

Field Summary
protected  char[] alphabet
          Set of available characters.
protected  java.lang.String axiom
          Initial configuration of L-system.
protected  java.lang.String[] rule
          Production rule of each character of the alphabet.
protected  java.lang.String tree
          Container to hold the current state of the L-system.
 
Constructor Summary
LSystem()
           
 
Method Summary
 java.lang.String getTree()
          Make the current state of the L-system available, e.g. for interpreting the string using turtle graphics commands.
 void iterate(int maxLength)
          Generate the tree by applying the rules until the description has a given length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alphabet

protected char[] alphabet
Set of available characters.

axiom

protected java.lang.String axiom
Initial configuration of L-system.

rule

protected java.lang.String[] rule
Production rule of each character of the alphabet. There must exist one rule per character.

tree

protected java.lang.String tree
Container to hold the current state of the L-system.
Constructor Detail

LSystem

public LSystem()
Method Detail

iterate

public void iterate(int maxLength)
Generate the tree by applying the rules until the description has a given length.
Parameters:
maxLength - maximal length of tree until we continue to iterate.

getTree

public java.lang.String getTree()
Make the current state of the L-system available, e.g. for interpreting the string using turtle graphics commands.

JavaView® v2.00.008

The software JavaView® is copyright protected. All Rights Reserved.