java.lang.Object
de.grogra.graph.impl.Edge
de.grogra.graph.impl.Node
de.grogra.rgg.RGG
de.grogra.grogra.LSystem
- All Implemented Interfaces:
Manageable
,PersistenceCapable
,Shareable
,RegistryContext
,Selectable
,UserFields
,XObject
,Map
,Serializable
,Observer
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class de.grogra.graph.impl.Node
Node.AccessorBridge, Node.FieldAttributeAccessor, Node.NType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Node.NType
float
static final Node.NType.Field
Contains the current node which matched the left hand side of a rule, or which is the current node of an arithmetical-structural computation.protected float[]
int
static final Node.NType.Field
float
Contains the value of GROGRA's register 0.float
Contains the value of GROGRA's register 1.float
Contains the value of GROGRA's register 2.float
Contains the value of GROGRA's register 3.float
Contains the value of GROGRA's register 4.float
Contains the value of GROGRA's register 5.float
Contains the value of GROGRA's register 6.float
Contains the value of GROGRA's register 7.float
Contains the value of GROGRA's register 8.float
Contains the value of GROGRA's register 9.Fields inherited from class de.grogra.rgg.RGG
classesToIgnoreOrConsider$FIELD, consider$FIELD, doRun$FIELD, GROUP_TYPE, I18N, initialTurtleState, initialTurtleState$FIELD, STEPRUN
Fields inherited from class de.grogra.graph.impl.Node
ADDITIONAL_FIELDS, bits, DELETED, EXTENT_BIT, EXTENT_MASK, extentIndex$FIELD, extentTail$FIELD, HAS_OBSERVERS, IS_INTERPRETIVE, isInterpretive$FIELD, LAST_EXTENT_INDEX, layer$FIELD, MARK, mark$FIELD, MAX_RESOLUTION, MIME_TYPE, MIN_RESOLUTION, MIN_UNUSED_SPECIAL_OF_SOURCE, MIN_UNUSED_SPECIAL_OF_TARGET, name$FIELD, RESOLUTION_BIT, RESOLUTION_MASK, resolution$FIELD, USED_BITS
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
assignLocalRegister
(int no, float value) Go back to the next shoot with the given localregisterno and assign the given valueprotected void
assignLocalRegisterAdd
(int no, float value) Go back to the next shoot with the given localregisterno and add the given valueprotected void
assignLocalRegisterMul
(int no, float value) Go back to the next shoot with the given localregisterno and multiply the given valueprotected void
assignReferenceShoot
(int no, float value) Go to the reference shoot (select by function21) and assign the localregisterno with the given valueprotected void
assignReferenceShootAdd
(int no, float value) Go to the reference shoot (select by function21) and add the localregisterno with the given valueprotected void
assignReferenceShootMul
(int no, float value) Go to the reference shoot (select by function21) and multiply the localregisterno with the given valuestatic float
atan
(float x) static float
atg
(float x) static LSystem
current()
float
The GROGRA variable of type "length" returns the length of the associated shoot of thecurrentNode
if generative rules are active, or the value oflength
of the current turtle state if interpretative rules are active.float
Returns the global x-coordinate of the tip of the associated shoot of thecurrentNode
.float
Returns the global y-coordinate of the tip of the associated shoot of thecurrentNode
.float
Returns the global z-coordinate of the tip of the associated shoot of thecurrentNode
.void
static float
exp
(float x) static float
floor
(float x) float
function1
(double minLength) static float
function10
(float x) static float
function11
(float n, float k, float b, float c2, float d) static float
function12
(float i, float age) static float
function13
(double xl, double xf) GROGRA function 13 Calculation of number of lateral buds from shoot lengthfloat
function15
(int color) float
function2
(double minLength, int color) float
function20
(int color) float
function21
(int color) float
GROGRA function 3 computes the sum of theparameter
values of the turtle states of allShoot
s emerging from thecurrentNode
.float
function30
(float arg1, float arg2, float arg3) Auxilliary function for control purposes.float
function31
(float arg1, float arg2, float arg3) float
function32
(float arg1, float arg2, float arg3) float
function33
(float arg1, float arg2, float arg3) float
function34
(float arg1, float arg2, float arg3) float
function35
(float arg1, float arg2, float arg3) float
function36
(float arg1, float arg2, float arg3) float
function37
(float arg1, float arg2, float arg3) float
function38
(float arg1, float arg2, float arg3) float
function39
(float arg1, float arg2, float arg3) float
function4
(double alpha, double minLength) float
function5
(double alpha) float
GROGRA function 6 computes the sum of thecarbon
values of the turtle states of allShoot
s emerging from thecurrentNode
.float
GROGRA function 7 computes the angle (in degrees) between the global z-direction and the local z-direction of thecurrentNode
.float
function8
(int color) float
function9
(double alpha, double minleng, int co) static LSystem
int
protected float
getLocalRegisterValue
(int no) Method is called, when the value of a localregister is neededprotected Node.NType
This method returns theNode.NType
which describes the managed fields of the class of this node.protected void
initializeApplyMenu
(Item d, boolean flat, boolean useRunCheckBox) protected void
initializeRunMenu
(Item d, boolean flat, boolean useRunCheckBox) void
static float
log
(float x) static float
max
(float a, float b) void
method1()
Computated the distribution of assimilate in a simple plant-model.void
method10()
Interface to branch library of TRAGIC++ (BITOEK, XI/1998)void
method12()
Writes all carbon-values of shoots with the color 14 to method12.datvoid
method30()
Auxiliary method for control purposes: Scans through the whole structure, finds trees, whorls and branches.void
method31()
void
method32()
Creates boxes for every branch and calculates different kind of information of shoots, which belong to different boxes.void
method33()
void
method34()
void
method35()
void
method36()
void
method37()
void
method38()
void
method39()
void
method4()
Write the current-structure in a binary-file strutemp.dat.void
method40()
void
method41()
void
method42()
void
method43()
void
method44()
static float
min
(float a, float b) protected Node
This method returns a new instance of the class of this node.static float
normal
(float mu, float sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemu
and standard deviationsigma
.void
patternMatched
(RGGProducer prod) Invoked after a pattern of a rule has matched, but before the right-hand side of the rule is executed.static float
random()
Returns a pseudo-random number which is uniformly distributed between 0 and 1.protected void
reset()
This method can be invoked to reset the RGG to its initial state.static int
round
(float x) protected void
shutdown()
This method is invoked when an RGG instance is unloaded within GroIMP.static float
sqr
(float x) static float
sqrt
(float x) protected void
startup()
This method is invoked when an RGG instance is loaded within GroIMP.void
This generator method yieldsvoid
for every daughter shoot of the associated shoot of thecurrentNode
.void
This generator method yieldsvoid
for every shoot of the subtree starting at the associated shoot of thecurrentNode
.void
This generator method yieldsvoid
for every shoot in the path from the associated shoot of thecurrentNode
downwards to the root.static float
uniform
(float min, float max) Returns a pseudo-random number which is uniformly distributed betweenmin
andmax
.Methods inherited from class de.grogra.rgg.RGG
addLock, addTask, applyInterpretation, consider, getMainRGG, getRate, getRegistry, getRGGForTypeMap, getRoot, getSolver, getTasks, ignore, init, initializeTurtleState, integrate, integrate, interpret, invokeInit, isAutoClearMonitors, isMainRGG, isTransformationMethod, left, monitor, monitor, monitorPeriodic, observe, observe, pullLock, readChannelAt, readChannelAt, readChannelAt, right, run, runLater, runLater, setAutoClearMonitors, setSolver, setSolver, shutdown, solveTasks, startup, stop, toSelection, unmonitor, update
Methods inherited from class de.grogra.graph.impl.Node
addEdgeBitsTo, addReference, appendBranchNode, appendBranchNode, appendReferencesTo, clone, clone, cloneGraph, dump, dumpTree, dup, dupFrom, dupnew, dupUnmanagedFields, edgeChanged, fieldModified, findAdjacent, findRefinementType, get, getAccessor, getAccessor, getAttributes, getAxisParent, getBoolean, getBranch, getBranchLength, getBranchNode, getBranchTail, getByte, getChar, getCommonAncestor, getCurrentGraphState, getDirectChildCount, getDouble, getEdgeAttributeAccessor, getEdgeAttributes, getEdgeBitsTo, getEdgeTo, getExtentIndex, getFirst, getFirstEdge, getFloat, getGraph, getId, getIgnored, getIndex, getInstantiator, getInt, getLayer, getLong, getManageableType, getName, getNeighbor, getNext, getNType, getObject, getOrCreateEdgeTo, getOrNull, getPersistenceManager, getPredecessor, getProvider, getResolution, getShort, getSource, getStamp, getSuccessor, getSymbol, getSymbolColor, getTarget, getTransaction, getUserField, getUserFieldCount, getXClass, getXData, hasName, initProvider, initXClass, insertBranchNode, insertBranchNode, instantiateGraph, isAncestorOf, isDirection, isEncoarseOf, isManagingInstance, isMarked, isRoot, isSource, isTarget, manageableReadResolve, manageableWriteReplace, paramString, removeAll, removeEdgeBitsTo, removeFromChain, removeFromChain, removeReference, setBranch, setBranch, setExtentIndex, setGraphForDeserialization, setIgnored, setLayer, setMark, setName, setResolution, setSuccessor, setSuccessor, specialEdgeAdded, specialEdgeRefModified, specialEdgeRemoved, toString, writeReplace
Methods inherited from class de.grogra.graph.impl.Edge
addEdgeBits, getBitMark, getEdgeBits, getEdgeKeys, getObjectMark, getSpecialEdgeDescriptor, parseEdgeKeys, remove, removeEdgeBits, setBitMark, setEdgeBits, setObjectMark, testEdgeBits
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.grogra.persistence.PersistenceCapable
getBitMark, getObjectMark, setBitMark, setObjectMark
-
Field Details
-
angle
public float angle -
generation
public int generation -
r0
public float r0Contains the value of GROGRA's register 0. -
r1
public float r1Contains the value of GROGRA's register 1. -
r2
public float r2Contains the value of GROGRA's register 2. -
r3
public float r3Contains the value of GROGRA's register 3. -
r4
public float r4Contains the value of GROGRA's register 4. -
r5
public float r5Contains the value of GROGRA's register 5. -
r6
public float r6Contains the value of GROGRA's register 6. -
r7
public float r7Contains the value of GROGRA's register 7. -
r8
public float r8Contains the value of GROGRA's register 8. -
r9
public float r9Contains the value of GROGRA's register 9. -
defaultValuesForLocalRegisters
protected float[] defaultValuesForLocalRegisters -
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
-
angle$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:-
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 ofRGGRoot
is created and connected with the real root by a branch edge. -
A new instance of
Axiom
is created and inserted in the graph by a successor edge from theRGGRoot
instance. The result of this step is a graph containing anRGGRoot
which has a singleAxiom
as its successor. -
The method
RGG.init()
is invoked. This invocation is surrounded by transformation boundaries (seeLibrary.apply()
).
-
If there is an instance of
-
uniform
public static float uniform(float min, float max) Returns a pseudo-random number which is uniformly distributed betweenmin
andmax
.- Parameters:
min
- minimum valuemax
- maximum value- Returns:
- pseudo-random number between
min
andmax
-
normal
public static float normal(float mu, float sigma) Returns a pseudorandom number which is distributed according to a normal distribution with mean valuemu
and standard deviationsigma
.- Parameters:
mu
- mean valuesigma
- 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
This generator method yieldsvoid
for every shoot of the subtree starting at the associated shoot of thecurrentNode
.- Parameters:
c
- a consumer
-
sumdGenerator
This generator method yieldsvoid
for every daughter shoot of the associated shoot of thecurrentNode
.- Parameters:
c
- a consumer
-
sumpGenerator
This generator method yieldsvoid
for every shoot in the path from the associated shoot of thecurrentNode
downwards to the root.- Parameters:
c
- a consumer
-
patternMatched
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 thecurrentNode
.- Returns:
- x-coordinate of current shoot
-
currentYcoordinate
public float currentYcoordinate()Returns the global y-coordinate of the tip of the associated shoot of thecurrentNode
.- Returns:
- y-coordinate of current shoot
-
currentZcoordinate
public float currentZcoordinate()Returns the global z-coordinate of the tip of the associated shoot of thecurrentNode
.- Returns:
- z-coordinate of current shoot
-
currentLength
public float currentLength()The GROGRA variable of type "length" returns the length of the associated shoot of thecurrentNode
if generative rules are active, or the value oflength
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 theparameter
values of the turtle states of allShoot
s emerging from thecurrentNode
.- 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 thecarbon
values of the turtle states of allShoot
s emerging from thecurrentNode
.- 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 thecurrentNode
.- 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 shootxf
- 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 argumentarg2
- Second argumentarg3
- 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
-
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
-
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. -
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. -
derivation
public void derivation() -
interpretation
public void interpretation() -
initializeApplyMenu
- Overrides:
initializeApplyMenu
in classRGG
-
initializeRunMenu
- Overrides:
initializeRunMenu
in classRGG
-
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 localregisternovalue
- 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 localregisternovalue
- 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 localregisternovalue
- 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 localregisternovalue
- 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 localregisternovalue
- 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 localregisternovalue
- 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
Description copied from class:Node
This method returns theNode.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 classRGG
- Returns:
- type describing the managed fields of the class of this 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 classRGG
- Returns:
- new instance of class of this node
-