Model Requirements¶
mef_agri.models.requ.py
- class mef_agri.models.requ.Requirement(qname, qmodel_id, requesting_model, required_unit=None)¶
This class represents a quantity from a model in the model tree required by another model in the model tree. Via the
value
property, it is possible to get the quantity and also a setter is implemented, if one wants to change the value of the quantity in the foreign model of the model tree. Unit conversion is considered when thevalue
property is called through the usage of themef_agri.models.tree.ModelTree.get_quantity()
method.An instance of
Requirement
is callable if the underlying quantity is of typemef_agri.models.utils.HPFunction
. In this case the provided value is passed to the__call__()
method of the HPFunction and the computed value is returned (numpy.ndarray
).- Parameters:
qname (str) – name of the required quantity in the corresponding model of the model tree
qmodel_id (str) – id of the model which contains the required quantity
requesting_model (
mef_agri.models.base.Model
) – object reference of the requesting modelrequired_unit (str, optional) – unit of quantity which is required by the requesting model, defaults to None (see
mef_agri.models.utils.__UNITS__
)
- property value¶
- Returns:
get the requested quantity from the model tree (also acts as setter)
- Return type:
numpy.ndarray