///////////////////////////////////////////////////////////////////////////////////////////////////
// DreamEvaluator.h
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
///////////////////////////////////////////////////////////////////////////////////////////////////
// CDreamEvaluator
class CDreamEvaluator : public IDreamEvaluator
{
public:
/// <summary>Constructor</summary>
CDreamEvaluator();
/// <summary>Destructor</summary>
~CDreamEvaluator();
/// <summary>Plugin initialization. The first function called before using the evaluator</summary>
virtual HRESULT STDMETHODCALLTYPE InitPlugin(IDreamPluginInfo* pIPluginInfo) override;
/// <summary>Prepare input data and all other local data needed for the calculation.</summary>
virtual HRESULT STDMETHODCALLTYPE InitData(IDreamPluginInfo* pIPluginInfo,
IDreamInputParViewer* pIDreamInputParams
) override;
/// <summary>Prepare files in working directory for parallel calculation (one thread)</summary>
virtual HRESULT STDMETHODCALLTYPE PrepareWorkDir(BSTR strSourceDir,
BSTR strDestinationDir) override;
/// <summary>Calculate the likelihood of each proposal during DREAM calculation</summary>
virtual HRESULT STDMETHODCALLTYPE EvaluateProposal(IDreamInputParViewer* pInputPar, int iSim,
IDreamMatrix* x, IDreamMatrix* res,
BSTR strWorkingDir, BSTR strModelDataDir,
BSTR strModelBinDir) override;
/// <summary>Called after finishing the calculation</summary>
virtual HRESULT STDMETHODCALLTYPE OnCalculationFinished() override;
/// <summary>Return description of the last error</summary>
virtual HRESULT STDMETHODCALLTYPE GetLastError(BSTR* strErrorText) override;
/// <summary>Return default DREAM parameters</summary>
virtual HRESULT STDMETHODCALLTYPE GetInputParams(IDreamInputParams* pIDreamInputParams) override;
/// <summary>Return MinMax data</summary>
virtual HRESULT STDMETHODCALLTYPE GetMinMaxData(IDreamInputParViewer* pInputPar,
IDreamDataMinMax* pIMinMaxData) override;
/// <summary>Return Normal data</summary>
virtual HRESULT STDMETHODCALLTYPE GetNormalData(IDreamInputParViewer* pInputPar,
IDreamDataNormal* pINormalData) override;
/// <summary>Return Prior data</summary>
virtual HRESULT STDMETHODCALLTYPE GetPriorData(IDreamInputParViewer* pInputPar,
IDreamDataPrior* pIPriorData) override;
/// <summary>Return Custom Prior data</summary>
virtual HRESULT STDMETHODCALLTYPE GetPriorDataCustom(IDreamInputParViewer* pInputPar,
IDreamMatrix* x, IDreamMatrix* PR,
ePriorDistrib callType) override;
/// <summary>Return Measurement data</summary>
virtual HRESULT STDMETHODCALLTYPE GetMeasurementData(IDreamInputParViewer* pInputPar,
IDreamDataMeasurement* pIMeasureData,
BSTR strModelDataDir) override;
/// <summary>Return Approximate Bayesian Computation data</summary>
virtual HRESULT STDMETHODCALLTYPE GetBayesData(IDreamInputParViewer* pInputPar,
IDreamDataABC* pIBayesCompData,
BSTR strModelDataDir) override;
/// <summary>COM implementation</summary>
virtual HRESULT STDMETHODCALLTYPE QueryInterface(const IID& iid, void** ppv) override;
virtual ULONG STDMETHODCALLTYPE AddRef() override;
virtual ULONG STDMETHODCALLTYPE Release() override;
private:
/// <summary>Reference counter</summary>
long m_cRef;
};
///////////////////////////////////////////////////////////////////////////////////////////////////