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
Make it possible to map a set of variables from different scales into a scale, but with a different variable name. For example, if we want to take the value of Rm in the organs and pass the vector as input of Rm_organs we would do:
This allows to put Rm as output of our model, instead of having to rename it.
Before we had to have this kind of models:
struct PlantRm <:AbstractMaintenance_RespirationModelend
PlantSimEngine.inputs_(::PlantRm) = (Rm=[-Inf],)
PlantSimEngine.outputs_(::PlantRm) = (Rm_plant=-Inf,)
function PlantSimEngine.run!(::PlantRm, models, status, meteo, constants, extra=nothing)
status.Rm_plant =sum(status.Rm)
end
With this feature we could say that the input Rm from other scales takes another name, so we can use Rm for the output at this scale:
struct PlantRm <:AbstractMaintenance_RespirationModelend
PlantSimEngine.inputs_(::PlantRm) = (Rm_organs=[-Inf],)
PlantSimEngine.outputs_(::PlantRm) = (Rm=-Inf,)
function PlantSimEngine.run!(::PlantRm, models, status, meteo, constants, extra=nothing)
status.Rm =sum(status.Rm_organs)
end
This is much more consistent and allows to keep the same variable names across scales, e.g.Rm is the respiration maintenance of the given scale, whatever the scale.
The text was updated successfully, but these errors were encountered:
I read the code quickly, and I think we could do that for MappedVar by setting the var field to the variable that we get from other scales, and the var we put this into as the var we want to put it in, e.g.:
Make it possible to map a set of variables from different scales into a scale, but with a different variable name. For example, if we want to take the value of
Rm
in the organs and pass the vector as input ofRm_organs
we would do:This allows to put
Rm
as output of our model, instead of having to rename it.Before we had to have this kind of models:
With this feature we could say that the input Rm from other scales takes another name, so we can use
Rm
for the output at this scale:This is much more consistent and allows to keep the same variable names across scales, e.g.
Rm
is the respiration maintenance of the given scale, whatever the scale.The text was updated successfully, but these errors were encountered: