Class fmipp.export.FMIAdapterBase¶
-
class
FMIAdapterBase
¶ Base class for FMI adapter implementations. Defines abtract methods that must be implemented by inheriting classes. See here and here for an example of usage.
Descendants
Methods
-
enforceTimeStep
(stepSize)¶ Enforce time step, call from
init(...)
function.- Parameters
stepSize – value of the enforced step size (float)
-
checkEnforceTimeStep
()¶ Check if fixed time steps are enforced.
-
debugSetRealParameterValues
(realParameterValues)¶ Set parameters of type real (in debug mode):
- Parameters
realParameterValues (dict[str, float]) – dict of parameters of type real (must include all parameters of type real previously defined during the initialization)
-
debugSetRealInputValues
(realInputValues)¶ Set input values of type real (in debug mode).
- Parameters
realInputValues (dict[str, float]) – dict of input variables of type real (must include all input values of type real previously defined during the initialization)
-
debugGetRealOutputValues
()¶ Get output values of type real (in debug mode).
- Returns
dict of output variables of type real (includes all output variables of type real previously defined during the initialization)
- Return type
dict[str, float]
-
debugSetIntegerParameterValues
(integerParameterValues)¶ Set parameters of type integer (in debug mode).
- Parameters
integerParameterValues (dict[str, int]) – dict of parameters of type integer (must include all parameters of type integer previously defined during the initialization)
-
debugSetIntegerInputValues
(integerInputValues)¶ Set input values of type integer (in debug mode).
- Parameters
integerInputValues (dict[str, int]) – dict of input variables of type integer (must include all input variables of type integer previously defined during the initialization)
-
debugGetIntegerOutputValues
()¶ Get output values of type integer (in debug mode).
- Returns
dict of output variables of type integer (includes all output variables of type integer previously defined during the initialization)
- Return type
dict[str, int]
-
debugSetBooleanParameterValues
(booleanParameterValues)¶ Set parameters of type boolean (in debug mode).
- Parameters
booleanParameterValues (dict[str, bool]) – dict of parameters of type boolean (must include all parameters of type boolean previously defined during the initialization)
-
debugSetBooleanInputValues
(booleanInputValues)¶ Set input values of type boolean (in debug mode).
- Parameters
booleanInputValues (dict[str, bool]) – dict of input variables of type boolean (must include all input variables of type boolean previously defined during the initialization)
-
debugGetBooleanOutputValues
()¶ Get output values of type boolean (in debug mode).
- Returns
dict of output variables of type boolean (includes all output variables of type boolean previously defined during the initialization)
- Return type
dict[str, bool]
-
debugSetStringParameterValues
(stringParameterValues)¶ Set parameters of type string (in debug mode).
- Parameters
stringParameterValues (dict[str, str]) – dict of parameters of type string (must include all parameters of type string previously defined during the initialization)
-
debugSetStringInputValues
(stringInputValues)¶ Set input values of type string (in debug mode).
- Parameters
stringInputValues (dict[str, str]) – dict of input variables of type string (must include all input variables of type string previously defined during the initialization)
-
debugGetStringOutputValues
()¶ Get output values of type string (in debug mode).
- Returns
dict of output variables of type string (includes all output variables of type string previously defined during the initialization)
- Return type
dict[str, str]
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)
-
abstract
defineRealParameters
(*parameterNames)¶ Define parameters (of type real).
- Parameters
*parameterNames (str) – names of parameters of type real
-
abstract
defineIntegerParameters
(*parameterNames)¶ Define parameters (of type integer).
- Parameters
*parameterNames (str) – names of parameters of type integer
-
abstract
defineBooleanParameters
(*parameterNames)¶ Define parameters (of type boolean).
- Parameters
*parameterNames (str) – names of parameters of type boolean
-
abstract
defineStringParameters
(*parameterNames)¶ Define parameters (of type string).
- Parameters
*parameterNames (str) – names of parameters of type string
-
abstract
defineRealInputs
(*inputVariableNames)¶ Define input variables (of type real).
- Parameters
*inputVariableNames (str) – names of input variables of type real
-
abstract
defineIntegerInputs
(*inputVariableNames)¶ Define input variables (of type integer).
- Parameters
*inputVariableNames (str) – names of input variables of type integer
-
abstract
defineBooleanInputs
(*inputVariableNames)¶ Define input variables (of type boolean).
- Parameters
*inputVariableNames (str) – names of input variables of type boolean
-
abstract
defineStringInputs
(*inputVariableNames)¶ Define input variables (of type string).
- Parameters
*inputVariableNames (str) – names of input variables of type string
-
abstract
defineRealOutputs
(*outputVariableNames)¶ Define output variables (of type real).
- Parameters
*outputVariableNames (str) – names of output variables of type real
-
abstract
defineIntegerOutputs
(*outputVariableNames)¶ Define output variables (of type integer).
- Parameters
*outputVariableNames (str) – names of output variables of type integer
-
abstract
defineBooleanOutputs
(*outputVariableNames)¶ Define output variables (of type boolean).
- Parameters
*outputVariableNames (str) – names of output variables of type boolean
-
abstract
defineStringOutputs
(*outputVariableNames)¶ Define output variables (of type string).
- Parameters
*outputVariableNames (str) – names of output variables of type string
-
abstract
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]
-
abstract
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]
-
abstract
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]
-
abstract
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]
-
abstract
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]
-
abstract
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]
-
abstract
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]
-
abstract
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]
-
abstract
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)
-
abstract
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)
-
abstract
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)
-
abstract
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)
-