modeci_mdf.execution_engine.EvaluableParameter
- class modeci_mdf.execution_engine.EvaluableParameter(parameter: Parameter, verbose: bool = False)[source]
Bases:
objectEvaluates the current value of a
Parameterduring the MDF graph execution.- Parameters:
parameter – The parameter to evaluate during execution.
verbose – Whether to print output of parameter calculations.
Methods
evaluate(parameters[, time_increment, ...])Evaluate the parameter and store the result in the
curr_valueattribute.get_current_value(parameters[, array_format])Get the current value of the parameter; evaluates the expression if the current value has not yet been set.
- get_current_value(parameters: Dict[str, Any], array_format: str = 'numpy') Any[source]
Get the current value of the parameter; evaluates the expression if the current value has not yet been set. Note: this is different from
'evaluate', as calling that method multiple times can change the state of the parameter, but calling this should not reevaluate the parameter if it has a current value.- Parameters:
parameters – a dictionary of parameters and their values that may or may not be needed to evaluate this parameter.
array_format – The array format to use (either
'numpy'ortensorflow').
- Returns:
The evaluated value of the parameter.
- evaluate(parameters: Dict[str, Any], time_increment: float | None = None, array_format: str = 'numpy') Any[source]
Evaluate the parameter and store the result in the
curr_valueattribute.- Parameters:
parameters – a dictionary of parameters and their values that may or may not be needed to evaluate this parameter.
time_increment – a floating point value specifying the timestep size, only used for
time_derivativeparametersarray_format – The array format to use (either
'numpy'ortensorflow').
- Returns:
The current value of the parameter.