Leaf Venation
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This is an agent-based model of leaf veins being formed inside a leaf!
HOW IT WORKS
I got an awesome code by Steven Brewer that creates the venation pattern.
A function called "setup" clears everything away and sets up the dot that begins the leaf's veins.
There is just one function called "go". The "step" button calls this function once. The "go" button, calls it forever.
In the function, the turtle moves forward six steps, and creates a branch at a 35 degree angle on both sides (to maintain symmetry). The veins stops branching out in 4 ticks.
The turtle and background was made and designed by me (Veronica!)
Comments and Questions
breed [leafs leaf] breed [stems stem] stems-own [ gen ] to setup clear-all create-stems 1 [ set shape "dot" setxy 0 min-pycor pd set heading 0 set gen 1 set color green ] reset-ticks end to go create-leafs 1 [ set shape "leaf 2" set size 30 set color 68 ] ask stems [ fd (3 * ( 2 / gen )) hatch 1 [ rt 35 set gen gen + 1] hatch 1 [ lt 35 set gen gen + 1] if not (who = 0) [die] ] tick if (ticks > 4) [ask stems [die] stop] end
There are 3 versions of this model.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.