PlantGraphs.jl

Dynamic graphs for simulating plant growth and development
Author VirtualPlantLab
Popularity
1 Star
Updated Last
2 Months Ago
Started In
August 2023

PlantGraphs

Stable Dev CI Coverage Aqua QA ColPrac SciML Code Style DOI

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.

1. Installation

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")

2. Usage

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)