Class fmipp.export.FMIAdapterV2¶
-
class
FMIAdapterV2¶ Abtract base class for defining FMUs for Co-Simulation compliant to FMI version 2.0. To implement an FMU, inherit a new class from class FMIAdapterBase that implements the methods
init(…)anddoStep(…)This class is a user-friendly wrapper for the functionality provided by the SWIG-generated Python bindings of the FMI++ library. See here and here for an example of usage.Ancestors
Abstract Methods
-
abstract
init(currentCommunicationPoint)¶ Initialize the FMU (definition of input/output variables and parameters, enforce step size).
- Parameters
currentCommunicationPoint (float) – current communication point of the master algorithm during initialization (float)
-
abstract
doStep(currentCommunicationPoint, communicationStepSize)¶ Make a simulation step.
- Parameters
currentCommunicationPoint (float) – current communication point of the master algorithm (float)
communicationStepSize (float) – communication step size (float)
Methods
-
defineRealParameters(*parameterNames)¶ Define parameters (of type real).
- Parameters
*parameterNames (str) – names of parameters of type real
-
defineIntegerParameters(*parameterNames)¶ Define parameters (of type integer).
- Parameters
*parameterNames (str) – names of parameters of type integer
-
defineBooleanParameters(*parameterNames)¶ Define parameters (of type boolean).
- Parameters
*parameterNames (str) – names of parameters of type boolean
-
defineStringParameters(*parameterNames)¶ Define parameters (of type string).
- Parameters
*parameterNames (str) – names of parameters of type string
-
defineRealInputs(*inputVariableNames)¶ Define input variables (of type real).
- Parameters
*inputVariableNames (str) – names of input variables of type real
-
defineIntegerInputs(*inputVariableNames)¶ Define input variables (of type integer).
- Parameters
*inputVariableNames (str) – names of input variables of type integer
-
defineBooleanInputs(*inputVariableNames)¶ Define input variables (of type boolean).
- Parameters
*inputVariableNames (str) – names of input variables of type boolean
-
defineStringInputs(*inputVariableNames)¶ Define input variables (of type string).
- Parameters
*inputVariableNames (str) – names of input variables of type string
-
defineRealOutputs(*outputVariableNames)¶ Define output variables (of type real).
- Parameters
*outputVariableNames (str) – names of output variables of type real
-
defineIntegerOutputs(*outputVariableNames)¶ Define output variables (of type integer).
- Parameters
*outputVariableNames (str) – names of output variables of type integer
-
defineBooleanOutputs(*outputVariableNames)¶ Define output variables (of type boolean).
- Parameters
*outputVariableNames (str) – names of output variables of type boolean
-
defineStringOutputs(*outputVariableNames)¶ Define output variables (of type string).
- Parameters
*outputVariableNames (str) – names of output variables of type string
-
getRealParameterValues()¶ Retrieve parameters (of type real).
- Returns
dict of parameters of type real (includes all parameters of type real previously defined during the initialization)
- Return type
dict[str, float]
-
getIntegerParameterValues()¶ Retrieve parameters (of type integer).
- Returns
dict of parameters of type integer (includes all parameters of type integer previously defined during the initialization)
- Return type
dict[str, int]
-
getBooleanParameterValues()¶ Retrieve parameters (of type boolean).
- Returns
dict of parameters of type boolean (includes all parameters of type boolean previously defined during the initialization)
- Return type
dict[str, bool]
-
getStringParameterValues()¶ Retrieve parameters (of type string).
- Returns
dict of parameters of type string (includes all parameters of type string previously defined during the initialization)
- Return type
dict[str, str]
-
getRealInputValues()¶ Retrieve input variables (of type real).
- Returns
dict of input variables of type real (includes all input variables of type real previously defined during the initialization)
- Return type
dict[str, float]
-
getIntegerInputValues()¶ Retrieve input variables (of type integer).
- Returns
dict of input variables of type real (includes all input variables of type real previously defined during the initialization)
- Return type
dict[str, int]
-
getBooleanInputValues()¶ Retrieve input variables (of type boolean).
- Returns
dict of input variables of type boolean (includes all input variables of type boolean previously defined during the initialization)
- Return type
dict[str, bool]
-
getStringInputValues()¶ Retrieve input variables (of type string).
- Returns
dict of input variables of type string (includes all input variables of type string previously defined during the initialization)
- Return type
dict[str, str]
-
setRealOutputValues(outputValues)¶ Set output variables (of type real).
- Parameters
outputValues (dict[str, float]) – dict of output variables of type real (must include all output variables of type real previously defined during the initialization)
-
setIntegerOutputValues(outputValues)¶ Set output variables (of type integer).
- Parameters
outputValues (dict[str, int]) – dict of output variables of type integer (must include all output variables of type integer previously defined during the initialization)
-
setBooleanOutputValues(outputValues)¶ Set output variables (of type boolean).
- Parameters
outputValues (dict[str, bool]) – dict of output variables of type boolean (must include all output variables of type boolean previously defined during the initialization)
-
setStringOutputValues(outputValues)¶ Set output variables (of type string).
- Parameters
outputValues (dict[str, str]) – dict of output variables of type string (must include all output variables of type string previously defined during the initialization)
-
abstract