You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AI_PACKAGE_SUMMARY.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This document explains how PlantSimEngine is structured internally, how models a
7
7
PlantSimEngine is a Julia framework for composing plant models as modular processes. Users or modelers define models that implement a process, declare inputs/outputs, and optionally declare hard dependencies (manual calls). The engine builds a dependency graph (soft dependencies via inputs/outputs and hard dependencies via explicit model calls) and executes models in dependency order. It supports single-scale model lists and multiscale model mappings on a plant graph (MTG).
Model coupling is done automatically by the package, and is based on the dependency graph between the models. To couple models, we just have to add them to the `ModelList`. For example, let's couple the `ToyLAIModel` with a model for light interception based on Beer's law:
139
+
Model coupling is done automatically by the package, and is based on the dependency graph between the models. To couple models, we just have to add them to the `ModelMapping`. For example, let's couple the `ToyLAIModel` with a model for light interception based on Beer's law:
140
140
141
141
```julia
142
142
# ] add PlantSimEngine, DataFrames, CSV
@@ -149,14 +149,14 @@ using PlantSimEngine.Examples
The package is designed to be easily scalable, and can be used to simulate models at different scales. For example, you can simulate a model at the leaf scale, and then couple it with models at any other scale, *e.g.* internode, plant, soil, scene scales. Here's an example of a simple model that simulates plant growth using sub-models operating at different scales:
Copy file name to clipboardExpand all lines: docs/src/developers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ It’s probably now safe to request a merge.
94
94
95
95
### Other helpful things
96
96
97
-
⁃ In the `/PlantSimEngine/test` folder, there are a few basic helper functions. One of them outputs vectors of modellists, weather data, and output variables, which are used as a test bank/matrix for some tests, and provides wide coverage. If you wrote new models, new combinations of models, or added some new weather data, it helps to add them to the banks.
97
+
⁃ In the `/PlantSimEngine/test` folder, there are a few basic helper functions. One of them outputs vectors of ModelMapping, weather data, and output variables, which are used as a test bank/matrix for some tests, and provides wide coverage. If you wrote new models, new combinations of models, or added some new weather data, it helps to add them to the banks.
98
98
⁃ New downstream packages are worth adding to the integration and downstream package registry.
99
99
⁃ Unusual corner-cases are worth giving their own unit tests. Newly fixed bugs as well, even if the fix is fairly trivial.
Model coupling is done automatically by the package, and is based on the dependency graph between the models. To couple models, we just have to add them to the `ModelList`. For example, let's couple the `ToyLAIModel` with a model for light interception based on Beer's law:
144
+
Model coupling is done automatically by the package, and is based on the dependency graph between the models. To couple models, we just have to add them to the `ModelMapping`. For example, let's couple the `ToyLAIModel` with a model for light interception based on Beer's law:
145
145
146
146
```@example readme
147
147
# ] add PlantSimEngine, DataFrames, CSV
@@ -153,18 +153,18 @@ using PlantSimEngine.Examples
The package is designed to be easily scalable, and can be used to simulate models at different scales. For example, you can simulate a model at the leaf scale, and then couple it with models at any other scale, *e.g.* internode, plant, soil, scene scales. Here's an example of a simple model that simulates plant growth using sub-models operating at different scales:
206
206
207
207
```@example readme
208
-
mapping = Dict(
208
+
mapping = ModelMapping(
209
209
"Scene" => ToyDegreeDaysCumulModel(),
210
210
"Plant" => (
211
211
MultiScaleModel(
@@ -295,8 +295,9 @@ We can then extract the outputs and convert them to a `DataFrame` for each scale
295
295
296
296
```@example readme
297
297
using DataFrames
298
-
df_dict = convert_outputs(out, DataFrame)
299
-
sort!(df_dict["Leaf"], [:timestep, :node])
298
+
df_outputs = convert_outputs(out, DataFrame)
299
+
leaf_df = df_outputs isa AbstractDict ? df_outputs["Leaf"] : df_outputs
300
+
sort!(leaf_df, [:timestep, :node])
300
301
```
301
302
302
303
An example output of a multiscale simulation is shown in the documentation of PlantBiophysics.jl:
Copy file name to clipboardExpand all lines: docs/src/model_coupling/model_coupling_user.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ using PlantSimEngine, PlantMeteo
5
5
# Import the example models defined in the `Examples` sub-module:
6
6
using PlantSimEngine.Examples
7
7
8
-
m = ModelList(
8
+
m = ModelMapping(
9
9
Process1Model(2.0),
10
10
Process2Model(),
11
11
Process3Model(),
@@ -44,7 +44,7 @@ using PlantSimEngine.Examples
44
44
Here is how we can make the model coupling:
45
45
46
46
```@example usepkg
47
-
m = ModelList(Process1Model(2.0), Process2Model(), Process3Model())
47
+
m = ModelMapping(Process1Model(2.0), Process2Model(), Process3Model())
48
48
nothing # hide
49
49
```
50
50
@@ -75,7 +75,7 @@ outputs(Process2Model())
75
75
So considering those two models, we only need `var1` and `var2` to be initialized, as `var3` is computed. This is why we recommend [`to_initialize`](@ref) instead of [`inputs`](@ref), because it returns only the variables that need to be initialized, considering that some inputs are duplicated between models, and some are computed by other models (they are outputs of a model):
76
76
77
77
```@example usepkg
78
-
m = ModelList(
78
+
m = ModelMapping(
79
79
Process1Model(2.0),
80
80
Process2Model(),
81
81
Process3Model(),
@@ -88,7 +88,7 @@ to_initialize(m)
88
88
The most straightforward way of initializing a model list is by giving the initializations to the `status` keyword argument during instantiation:
89
89
90
90
```@example usepkg
91
-
m = ModelList(
91
+
m = ModelMapping(
92
92
Process1Model(2.0),
93
93
Process2Model(),
94
94
Process3Model(),
@@ -118,7 +118,7 @@ All following models (`Process4Model` to `Process7Model`) do not call explicitly
118
118
Let's make a new model list including the soft-coupled models:
Copy file name to clipboardExpand all lines: docs/src/model_execution.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Simulation order
4
4
5
-
`PlantSimEngine.jl` uses the [`ModelList`](@ref) to automatically compute a dependency graph between the models and run the simulation in the correct order. When running a simulation with [`run!`](@ref), the models are then executed following this simple set of rules:
5
+
`PlantSimEngine.jl` uses the [`ModelMapping`](@ref) to automatically compute a dependency graph between the models and run the simulation in the correct order. When running a simulation with [`run!`](@ref), the models are then executed following this simple set of rules:
6
6
7
7
1. Independent models are run first. A model is independent if it can be run independently from other models, only using initializations (or nothing).
8
8
2. Then, models that have a dependency on other models are run. The first ones are the ones that depend on an independent model. Then the ones that are children of the second ones, and then their children ... until no children are found anymore. There are two types of children models (*i.e.* dependencies): hard and soft dependencies:
@@ -93,7 +93,7 @@ aggregates over that civil day (including later timesteps from that day when ava
0 commit comments