Module rgg

Class LSystem

All Implemented Interfaces:
Manageable, PersistenceCapable, Shareable, RegistryContext, Selectable, UserFields, XObject, Map, Serializable, Observer

public class LSystem extends RGG
See Also:
  • Field Details

    • angle

      public float angle
    • generation

      public int generation
    • r0

      public float r0
      Contains the value of GROGRA's register 0.
    • r1

      public float r1
      Contains the value of GROGRA's register 1.
    • r2

      public float r2
      Contains the value of GROGRA's register 2.
    • r3

      public float r3
      Contains the value of GROGRA's register 3.
    • r4

      public float r4
      Contains the value of GROGRA's register 4.
    • r5

      public float r5
      Contains the value of GROGRA's register 5.
    • r6

      public float r6
      Contains the value of GROGRA's register 6.
    • r7

      public float r7
      Contains the value of GROGRA's register 7.
    • r8

      public float r8
      Contains the value of GROGRA's register 8.
    • r9

      public float r9
      Contains the value of GROGRA's register 9.
    • defaultValuesForLocalRegisters

      protected float[] defaultValuesForLocalRegisters
    • currentNode

      public Node currentNode
      Contains the current node which matched the left hand side of a rule, or which is the current node of an arithmetical-structural computation.
    • $TYPE

      public static final Node.NType $TYPE
    • angle$FIELD

      public static final Node.NType.Field angle$FIELD
    • generation$FIELD

      public static final Node.NType.Field generation$FIELD
  • Constructor Details

    • LSystem

      public LSystem()
  • Method Details

    • reset

      protected void reset()
      Description copied from class: RGG
      This method can be invoked to reset the RGG to its initial state. The following steps are performed:
      1. If there is an instance of RGGRoot which is connected with the real root of the graph by a branch edge, then this instance is removed. A new instance of RGGRoot is created and connected with the real root by a branch edge.
      2. A new instance of Axiom is created and inserted in the graph by a successor edge from the RGGRoot instance. The result of this step is a graph containing an RGGRoot which has a single Axiom as its successor.
      3. The method RGG.init() is invoked. This invocation is surrounded by transformation boundaries (see Library.apply()).
      This method is also invoked when a newly compiled RGG is instantiated.
      Overrides:
      reset in class RGG
    • uniform

      public static float uniform(float min, float max)
      Returns a pseudo-random number which is uniformly distributed between min and max.
      Parameters:
      min - minimum value
      max - maximum value
      Returns:
      pseudo-random number between min and max
    • normal

      public static float normal(float mu, float sigma)
      Returns a pseudorandom number which is distributed according to a normal distribution with mean value mu and standard deviation sigma.
      Parameters:
      mu - mean value
      sigma - standard deviation
      Returns:
      normally distributed random number
    • random

      public static float random()
      Returns a pseudo-random number which is uniformly distributed between 0 and 1.
      Returns:
      pseudo-random number between 0 and 1
    • sumGenerator

      public void sumGenerator(VoidConsumer c)
      This generator method yields void for every shoot of the subtree starting at the associated shoot of the currentNode.
      Parameters:
      c - a consumer
    • sumdGenerator

      public void sumdGenerator(VoidConsumer c)
      This generator method yields void for every daughter shoot of the associated shoot of the currentNode.
      Parameters:
      c - a consumer
    • sumpGenerator

      public void sumpGenerator(VoidConsumer c)
      This generator method yields void for every shoot in the path from the associated shoot of the currentNode downwards to the root.
      Parameters:
      c - a consumer
    • patternMatched

      public void patternMatched(RGGProducer prod)
      Invoked after a pattern of a rule has matched, but before the right-hand side of the rule is executed.
      Parameters:
      prod - the producer which is used for the right-hand side
    • currentXcoordinate

      public float currentXcoordinate()
      Returns the global x-coordinate of the tip of the associated shoot of the currentNode.
      Returns:
      x-coordinate of current shoot
    • currentYcoordinate

      public float currentYcoordinate()
      Returns the global y-coordinate of the tip of the associated shoot of the currentNode.
      Returns:
      y-coordinate of current shoot
    • currentZcoordinate

      public float currentZcoordinate()
      Returns the global z-coordinate of the tip of the associated shoot of the currentNode.
      Returns:
      z-coordinate of current shoot
    • currentLength

      public float currentLength()
      The GROGRA variable of type "length" returns the length of the associated shoot of the currentNode if generative rules are active, or the value of length of the current turtle state if interpretative rules are active.
      Returns:
      current length
    • function1

      public float function1(double minLength)
    • function2

      public float function2(double minLength, int color)
    • function3

      public float function3()
      GROGRA function 3 computes the sum of the parameter values of the turtle states of all Shoots emerging from the currentNode.
      Returns:
      sum of parameter values
    • function4

      public float function4(double alpha, double minLength)
    • function5

      public float function5(double alpha)
    • function6

      public float function6()
      GROGRA function 6 computes the sum of the carbon values of the turtle states of all Shoots emerging from the currentNode.
      Returns:
      sum of carbon values
    • function7

      public float function7()
      GROGRA function 7 computes the angle (in degrees) between the global z-direction and the local z-direction of the currentNode.
      Returns:
      angle between local and global z-direction in degrees
    • function8

      public float function8(int color)
    • function9

      public float function9(double alpha, double minleng, int co)
    • function10

      public static float function10(float x)
    • function11

      public static float function11(float n, float k, float b, float c2, float d)
    • function12

      public static float function12(float i, float age)
    • function13

      public static float function13(double xl, double xf)
      GROGRA function 13 Calculation of number of lateral buds from shoot length
      Parameters:
      xl - the length of the shoot
      xf - an (optional) conversion factor to be multiplied with xl^2
      Returns:
    • function15

      public float function15(int color)
    • function20

      public float function20(int color)
    • function21

      public float function21(int color)
    • function30

      public float function30(float arg1, float arg2, float arg3)
      Auxilliary function for control purposes. Write the arguments to the console.
      Parameters:
      arg1 - First argument
      arg2 - Second argument
      arg3 - third argument
      Returns:
      Constant 0.0f
    • function31

      public float function31(float arg1, float arg2, float arg3)
    • function32

      public float function32(float arg1, float arg2, float arg3)
    • function33

      public float function33(float arg1, float arg2, float arg3)
    • function34

      public float function34(float arg1, float arg2, float arg3)
    • function35

      public float function35(float arg1, float arg2, float arg3)
    • function36

      public float function36(float arg1, float arg2, float arg3)
    • function37

      public float function37(float arg1, float arg2, float arg3)
    • function38

      public float function38(float arg1, float arg2, float arg3)
    • function39

      public float function39(float arg1, float arg2, float arg3)
    • method1

      public void method1()
      Computated the distribution of assimilate in a simple plant-model. Use the global registers 1 - 4. (non-realistic example, only for demonstration)
    • method4

      public void method4()
      Write the current-structure in a binary-file strutemp.dat. WARNING: The stored structured is using big endian for coding the bytes (highest byte first). The class RandomAccessFile does not support little endian coding for binary-files. Big endian is normally used on UNIX-systems. All int-values are stored as 16-bit-values, for the compatibility to system where int-values have a range of 16-bits and for the compatibility to GroGra-files. All long-values are stored as 32-bit-values. Additional ... there could be problems with the floating point values ... it's in the Java-format. The GroGra auxiliary-variables yka, xke and yke will saved with the value 0. The GroGra auxiliary-variable xka will saved with the carbon-value. The GroGra scale-counter-variable is currently saved with the value 0. The local registers of a shoot are not saved (now).
    • method10

      public void method10()
      Interface to branch library of TRAGIC++ (BITOEK, XI/1998)
    • method12

      public void method12()
      Writes all carbon-values of shoots with the color 14 to method12.dat
    • method30

      public void method30()
      Auxiliary method for control purposes: Scans through the whole structure, finds trees, whorls and branches.
    • method32

      public void method32()
      Creates boxes for every branch and calculates different kind of information of shoots, which belong to different boxes. (These boxes are used, when shading, photosynthesis, formation of new shoots etc. is calculated)
    • method31

      public void method31()
    • method33

      public void method33()
    • method34

      public void method34()
    • method35

      public void method35()
    • method36

      public void method36()
    • method37

      public void method37()
    • method38

      public void method38()
    • method39

      public void method39()
    • method40

      public void method40()
    • method41

      public void method41()
    • method42

      public void method42()
    • method43

      public void method43()
    • method44

      public void method44()
    • getShootPopulation

      public Dataset getShootPopulation()
    • getRefShoot

      public Shoot getRefShoot()
    • getGenerationNo

      public int getGenerationNo()
    • floor

      public static float floor(float x)
    • exp

      public static float exp(float x)
    • log

      public static float log(float x)
    • sqr

      public static float sqr(float x)
    • sqrt

      public static float sqrt(float x)
    • atan

      public static float atan(float x)
    • atg

      public static float atg(float x)
    • round

      public static int round(float x)
    • min

      public static float min(float a, float b)
    • max

      public static float max(float a, float b)
    • get

      public static LSystem get(Registry r)
    • current

      public static LSystem current()
    • startup

      protected void startup()
      Description copied from class: RGG
      This method is invoked when an RGG instance is loaded within GroIMP. This happens after the compilation of its source code and after loading a project containing an RGG.
      If this method is overridden, super.startup(); should be invoked at first.
      Overrides:
      startup in class RGG
    • shutdown

      protected void shutdown()
      Description copied from class: RGG
      This method is invoked when an RGG instance is unloaded within GroIMP. This happens to an old RGG instance after compilation when this old instance is to be replaced by the newly compiled RGG instance.
      If this method is overriden, super.shutdown(); should be invoked.
      Overrides:
      shutdown in class RGG
    • derivation

      public void derivation()
    • interpretation

      public void interpretation()
    • initializeApplyMenu

      protected void initializeApplyMenu(Item d, boolean flat, boolean useRunCheckBox)
      Overrides:
      initializeApplyMenu in class RGG
    • initializeRunMenu

      protected void initializeRunMenu(Item d, boolean flat, boolean useRunCheckBox)
      Overrides:
      initializeRunMenu in class RGG
    • assignLocalRegister

      protected void assignLocalRegister(int no, float value)
      Go back to the next shoot with the given localregisterno and assign the given value
      Parameters:
      nr - the localregisterno
      value - the value
    • assignLocalRegisterAdd

      protected void assignLocalRegisterAdd(int no, float value)
      Go back to the next shoot with the given localregisterno and add the given value
      Parameters:
      nr - the localregisterno
      value - the value
    • assignLocalRegisterMul

      protected void assignLocalRegisterMul(int no, float value)
      Go back to the next shoot with the given localregisterno and multiply the given value
      Parameters:
      nr - the localregisterno
      value - the value
    • assignReferenceShoot

      protected void assignReferenceShoot(int no, float value)
      Go to the reference shoot (select by function21) and assign the localregisterno with the given value
      Parameters:
      nr - the localregisterno
      value - the value
    • assignReferenceShootAdd

      protected void assignReferenceShootAdd(int no, float value)
      Go to the reference shoot (select by function21) and add the localregisterno with the given value
      Parameters:
      nr - the localregisterno
      value - the value
    • assignReferenceShootMul

      protected void assignReferenceShootMul(int no, float value)
      Go to the reference shoot (select by function21) and multiply the localregisterno with the given value
      Parameters:
      nr - the localregisterno
      value - the value
    • getLocalRegisterValue

      protected float getLocalRegisterValue(int no)
      Method is called, when the value of a localregister is needed
      Parameters:
      no - number of the localregister
      Returns:
      the value
    • getNTypeImpl

      protected Node.NType getNTypeImpl()
      Description copied from class: Node
      This method returns the Node.NType which describes the managed fields of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      getNTypeImpl in class RGG
      Returns:
      type describing the managed fields of the class of this node
    • newInstance

      protected Node newInstance()
      Description copied from class: Node
      This method returns a new instance of the class of this node. This method has to be implemented in every concrete subclass.
      Overrides:
      newInstance in class RGG
      Returns:
      new instance of class of this node