The goal of PlantGraphs.jl is to provide a framework for building dynamic graphs for functional-structural plant models. This package is a component of the Virtual Plant Lab. Users should install instead the interface package VirtualPlantLab.jl.
You can install the latest stable version of PlantGraphs.jl with the Julia package manager:
] add PlantGraphs
Or the development version directly from here:
import Pkg
Pkg.add(url="https://github.com/VirtualPlantLab/PlantGraphs.jl", rev = "master")
Graphs from PlantGraphs.jl implement methods for most functions in the AbstractTrees.jl package, plus additional methods specific for functional-structural plant models. The following example shows how to create a simple graph, run a dynamic simulation and visualize the graph (check documentation for more details and examples):
using PlantGraphs
module algae
import PlantGraphs: Node
struct A <: Node end
struct B <: Node end
end
import .algae
axiom = algae.A()
rule1 = Rule(algae.A, rhs = x -> algae.A() + algae.B())
rule2 = Rule(algae.B, rhs = x -> algae.A())
organism = Graph(axiom = axiom, rules = (rule1, rule2))
import CairoMakie
draw(organism)
rewrite!(organism)
draw(organism)