Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better control over nodes used for the mapping. #58

Open
VEZY opened this issue Mar 26, 2024 · 0 comments
Open

Better control over nodes used for the mapping. #58

VEZY opened this issue Mar 26, 2024 · 0 comments

Comments

@VEZY
Copy link
Member

VEZY commented Mar 26, 2024

We need to be able to control which nodes in the MTG are used to map variables for a model. For example, at the time if we want to have a model that allocates carbon preferentially to the leaves closer to it, we could do this:

mapping = Dict(
    "Phytomer" => (
        MultiScaleModel(
            model=SpatializedCAllocationModel([parameters goes here...]),
            mapping=[
                :carbon_assimilation => ["Leaf"],
                :carbon_demand => ["Leaf", "Internode"],
                :carbon_allocation => ["Leaf", "Internode"]
            ],
        ),
    ),
    "Internode" => (
        CDemandModel(...),
    ),
    "Leaf" => (
        PhotosynthesisModel(...),
        CDemandModel(...),
    ),
)

But atm, PlantSimEngine would provide the values of all leaves in the plant, and if there are several plants, it would provide all leaves of all plants.

What we should do by default here is to provide only the leaves from the phytomer. What we should do:

To map a lower scale to a higher scale, we should only provide the lower scale that is "inside" the higher scale. For a mapping of a higher scale to a lower scale, we could search for all higher scales if it is given as a vector (e.g. ["Plant"]), or the first one if it is given as a scalar (e.g. "Plant").

Of course we should also consider how the package manages adding new organs, as it will change such mappings, but not for all organs.

Note: we can already manage such simulations using the node provided by default as input to the model (when #75 is merged).

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

No branches or pull requests

1 participant