modeci_mdf.execution_engine.EvaluableParameter

class modeci_mdf.execution_engine.EvaluableParameter(parameter: Parameter, verbose: bool = False)[source]

Bases: object

Evaluates the current value of a Parameter during 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_value attribute.

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' or tensorflow').

Returns:

The evaluated value of the parameter.

evaluate(parameters: Dict[str, Any], time_increment: Optional[float] = None, array_format: str = 'numpy') Any[source]

Evaluate the parameter and store the result in the curr_value attribute.

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_derivative parameters

  • array_format – The array format to use (either 'numpy' or tensorflow').

Returns:

The current value of the parameter.