| |
- builtins.object
-
- TransferFunction
class TransferFunction(builtins.object) |
|
TransferFunction(asceId, asceRunningId, validityTimeFrame, props, instance)
Base (and abstract) class to provide TFs in python programming language.
Usage: python TF implementations must extend this class and provide, as a minimum,
the implementation of the transfer method.
It is the python equivalent of the JavaTransferExecutor class |
|
Methods defined here:
- __init__(self, asceId, asceRunningId, validityTimeFrame, props, instance)
- Constructor
:param asceId: The ID of the ASCE that runs the python TF
:param asceRunningId: The running ID of the ASCE that runs the python TF
:param validityTimeFrame: The validity time frame (long)
:param props: a dictionary of properties
- eval(self, compInputs, actualOutput)
- The eval method to produce the output based on the value of the inputs
:param compInputs: computing element inputs (IASIOs)
:param actualOutput: the actual value of the output i.e. tha value computed at previous
iteration (IASIO)
:return: the new output of the ASCE (IASIO)
- getValue(self, inputs, id, instance)
- Get a value from its ID taking into account templates
It is the same method present in the JavaTransferExecutor and in ScalaTransferExecutor
:param inputs: the map of inputs as received in the eval method
:param id: the id (string) of the input (without template)
:param instance: the instance (int) or None if not templated
:return: the value or None if not found
- initialize(self, inputsInfo, outputInfo)
- Initialize the TF.
Must be overridden if the user provided implementation needs
to know the ID and type of the inputs and the output.
It iusuall implemented to increase the robustness for example
if the user implemented TF compare the value of the input with a threshold,
it can be used to check that the input is a numeric type.
:param inputsInfo: the list of IasioInfo with the ids and type of inputs
:param outputInfo: the type and ID of the output
:return: None
- isTemplated(self)
- :return: the number of the instance or NOne if not template
- setTemplateInstance(self, instance)
- Set the instance of the template, if any.
:param instance: the instance number or None if there is no template
:return:
- shutdown(self)
- Last method called when the object life terminates.
It is usually called to free acquired resources.
:return:
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |