11.3.1. Constructing the TMinimisation object
As stated above, the only available constructor is the one whose prototype includes an instance of a TRun-inheriting object. This approach provides a simple way to change the evaluator (e.g., from a C++ function to a Python function or an external code) and to use either a sequential approach (for a code) or a threaded one (to distribute locally the estimates).
In this case, the constructor should look like this:
# Constructor with a runner
TMinimisation(tds, runner, ns=1, option="")
This method takes up to four arguments, two of which are optional:
tds: a
TDataServerobject containing one attribute for each parameter to be calibrated. This is the
TDataServerobject calledtdsPar, defined in General introduction to data and model definition.runner: a
TRun-inheriting instance that contains all the model information and whose type determines how the estimates are distributed: it can either be aTSequentialRuninstance orTThreadedRunfor distributed computations.ns (optional): the number of samples to be produced. This parameter is not used in this context.
option (optional): the options that can be applied to the method. Options common to all calibration classes (those defined in the
TCalibrationclass) are discussed in Running the estimate.
A crucial step in this constructor is the creation of the instance that inherits from TRun. As mentioned
earlier, its type determines how the estimates are distributed. To construct such an object, one needs
to provide an evaluator (the available evaluators are described in detail in TEval).
The final step is to construct the TDistanceLikelihoodFunction, a mandatory step that
must always follow the constructor, using the setDistance method (following the prototype presented in Recommended distance and likelihood functions, construction method).
Advanced users also have the option to define a custom distance by following the prototype:
setDistance(distFunc, tdsRef, input, reference, weight="")