Skip to content

Improve model setup and share results with plant parts - #209

Open
VEZY wants to merge 212 commits into
mainfrom
distributed-output-targets
Open

Improve model setup and share results with plant parts#209
VEZY wants to merge 212 commits into
mainfrom
distributed-output-targets

Conversation

@VEZY

@VEZY VEZY commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • Simplify how models are built and run for plants with several parts.
  • Let a model send results to selected plant parts, including parts added later.
  • Add tests, examples, documentation, and speed checks.

VEZY added 30 commits March 18, 2026 12:11
- Added `Domain`, `SimulationMapping`, and `DomainSimulation` for composing plant, soil, scene, and future environment domains.
- Added cross-domain stream/value dependencies with `AllDomains(...)` and explicit `Route(...)` materialization.
- Added hard-domain dependencies with `HardDomains(...)`, `dependency_targets(...)`, `model_target(...)`, and `run_target!(...)` so scene models can manually run plant/soil targets, including iterative workflows.
- Added MTG-backed domain support with selectors, multi-plant domains, graph-domain output publication, dynamic topology registration, organ removal, and reparenting.
- Added `Updates(:var; after=...)` for intentional same-scale variable updates by later models.
- Added environment/microclimate backend protocol with `AbstractEnvironmentBackend`, `GlobalConstant`, `meteo_inputs_`, `meteo_outputs_`, sampling, scattering, and validation.
- Extended multirate support with `Dates`-based timesteps, inferred/explicit bindings, temporal output policies, scoped streams, meteo aggregation, and requested output export.
- Added MAESPA-style example in [examples/maespa_domain_example.jl](/Users/rvezy/Documents/dev/PlantSimEngine/examples/maespa_domain_example.jl) with two plant species, shared soil, scene-scale iterative energy balance, and hard-domain targets.
- Added docs for domain simulation, model traits, hard-domain target design, and implementation plan/handoff notes.
- Added focused tests for domains, environment backends, meteo traits, updates, and the MAESPA example.

Verification already run:
- `julia --project=test test/runtests.jl` passed: `1844 / 1844`
- `julia --project=docs docs/make.jl` passed
- `git diff --check` passed

Files to remember are untracked too, especially:
- `src/domains/domain_simulation.jl`
- `src/time/runtime/environment_backends.jl`
- `src/dependencies/update_dependencies.jl`
- `examples/maespa_domain_example.jl`
- new docs under `docs/src/dev/`
- new tests under `test/test-domain-simulation.jl`, `test/test-environment-backends.jl`, `test/test-maespa-domain-example.jl`, `test/test-meteo-traits.jl`, `test/test-updates.jl`
- remove ModelList compatibility
- replace Symbol("") mapping sentinels
- refactor repeated multirate input-resolution flow
- split the large domain runner into scheduler/routes/environment/graph/publication pieces
- replace assertions by more standard errors
Shared Status / StatusView interface helpers.
Extracted repeated test graph comparison runner.
Extracted toy tutorial MTG helpers.
Typed export plans, reverse mappings, temporal stream aliases.
Preserved renamed producer source variables in binding inference.
Added explicit domain DAG run ordering.
Added topology reindexing for RefVectors after add/remove/reparent.
Split MAESPA scene solver math from side effects and added validation tests.
Fix recursive call leading to stack overflow
compile_scene (line 638) now validates required inputs_(model) variables.
A required input is valid if it has a compiled Inputs(...)/inferred binding or already exists on the target object Status.
Missing inputs now error with application id, object id, and input name.
Added tests for missing inputs, ambiguous same-object producers, and status-provided inputs.
…cies.

Unscoped Inputs(...) / Calls(...) dependency selectors now infer scope from the consumer object:
scene consumers default to SceneScope()
non-scene consumers default to Self()
Direct public resolve_object_ids(scene, Many(...)) remains scene-wide unless within=... is explicit.
Shared cross-scope dependencies from organs now need explicit within=SceneScope(), as in the updated shared-soil test.
Added tests showing plant-level unscoped leaf inputs are plant-local, while scene-level unscoped leaf inputs are scene-wide.
Exceptional-organ Override(...).
Instance and object-level model replacement validation.
Concrete dispatch preserved for same-type parameter overrides.
explain_instances(scene) and instance membership in explain_objects.
New organs inherit instance kind and species.
Hard-called overridden models use the correct per-object implementation.
… their helpers, runtime, tests, and documentation.

This API was a failed tentative
- Overlap-weighted temporal windows, including pre-window held samples and output resampling.
- timestep_hint/meteo_hint delegation for object overrides.
- Atomic rejection of instance-root or ancestor removal/reparenting.
Dynamic organ creation repeatedly rebuilt scene bindings, selector matches, MTG IDs, and attribute/output structures—effectively rescanning the whole plant per organ. XPalm also had an ambiguous fruit-count producer binding. Incremental updates, caching, and explicit binding fixed it.
VEZY added 30 commits August 23, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant