FREE::SetupInterpolator Class Reference
[Setup utilities]

Class to generate interpolate setups between to given ones. More...

#include <freSetupInterpolator.h>

Collaboration diagram for FREE::SetupInterpolator:

Collaboration graph
FREE::SetupFREE::XMLStreamObjectFREE::ControllerCentral
[legend]

List of all members.

Public Member Functions

virtual const char * GetNameOfClass () const
void SetStartSetup (Setup *pSetup)
SetupGetStartSetup ()
void SetStopSetup (Setup *pSetup)
SetupGetStopSetup ()
void SetIterations (const int iIterations)
const int GetIterations ()
const int GetCurrentIteration ()
void ResetIteration ()
void SetSetupName (const std::string &sName)
const std::string GetSetupName ()
void ResetName ()
Setup::Pointer InterpolateSetup (const int iActIteration, const int iIterations)
Setup::Pointer InterpolateSetup (const int iActIteration)
Setup::Pointer InterpolateNext ()
 SetupInterpolator ()
 ~SetupInterpolator ()

Private Member Functions

void InterpolateParameter (ComponentSetup *pInterpolate, ComponentSetup *pStart, ComponentSetup *pStop, const std::string &sKey, const int &iActIteration, const int &iIterations)
void InterpolateComponent (ComponentSetup *pComponent, const int &iSectionID, const int &iActIteration, const int &iIterations)

Private Attributes

int m_CurrentIteration
int m_Iterations
std::string m_sName
Setupm_pStartSetup
Setupm_pStopSetup
ControllerCentral m_Central


Detailed Description

Class to generate interpolate setups between to given ones.

The SetupInterpolator is used to interpolate between to given setups. This is useful, if there is the need to evaluate the impact of a few parameter values and their changes over a given range. To ease this task, this class can manage the gradual change of numeric parameters, so there is no need to do it by hand. The to given setups defines the range of modification for all numeric values. If a value is equal in both setups, it won't be changed.
As mentioned all numeric parameters will be changed, this includes following:

Parameters, which don't match the criteria, will get the value of the first setup. The name of the interpolated setups can be specified, if not specified, the name of the start setup will be used. In both cases a suffix _ActIteration_Iterations+1 will be added.
Eg.: name is demo and the interpolations has 10 steps, then the resulting names are: demo_0_11 (the start setup), demo_1_11, demo_3_11 .. demo_11_11 (the stop setup).

Definition at line 56 of file freSetupInterpolator.h.


Constructor & Destructor Documentation

FREE::SetupInterpolator::SetupInterpolator (  ) 

Definition at line 141 of file freSetupInterpolator.cxx.

References m_Iterations, m_pStartSetup, m_pStopSetup, m_sName, ResetIteration(), and ResetName().

Here is the call graph for this function:

FREE::SetupInterpolator::ResetIterationFREE::SetupInterpolator::ResetName

FREE::SetupInterpolator::~SetupInterpolator (  ) 

Definition at line 152 of file freSetupInterpolator.cxx.


Member Function Documentation

virtual const char* FREE::SetupInterpolator::GetNameOfClass (  )  const [inline, virtual]

Definition at line 59 of file freSetupInterpolator.h.

void FREE::SetupInterpolator::SetStartSetup ( Setup pSetup  ) 

Defines the starting setup for the interpolation.

Remarks:
The change of the start setup resets the name and the iteration position to zero.
Parameters:
[in] pSetup Pointer to the starting setup.
Implementation of FREE::SetupInterpolator //////////////////////

Definition at line 37 of file freSetupInterpolator.cxx.

References m_pStartSetup, and ResetIteration().

Here is the call graph for this function:

FREE::SetupInterpolator::ResetIteration

Setup * FREE::SetupInterpolator::GetStartSetup (  ) 

Returns the pointer to the current starting setup for the interpolation.

Returns:
Pointer to the starting setup.

Definition at line 45 of file freSetupInterpolator.cxx.

References m_pStartSetup.

void FREE::SetupInterpolator::SetStopSetup ( Setup pSetup  ) 

Defines the stopping setup for the interpolation.

Remarks:
The change of the stop setup resets the name and the iteration position to zero.
Parameters:
[in] pSetup Pointer to the stopping setup.

Definition at line 50 of file freSetupInterpolator.cxx.

References m_pStopSetup, and ResetIteration().

Here is the call graph for this function:

FREE::SetupInterpolator::ResetIteration

Setup * FREE::SetupInterpolator::GetStopSetup (  ) 

Returns the pointer to the current stopping setup for the interpolation.

Returns:
Pointer to the stopping setup.

Definition at line 58 of file freSetupInterpolator.cxx.

References m_pStopSetup.

void FREE::SetupInterpolator::SetIterations ( const int  iIterations  ) 

Defines the number of iteration steps the interpolation should do between the start and the stop setup; so the count of resulting setups is interaction+2. So, it is defines the step size for the gradual change.

Remarks:
The change of the iteration count resets the iteration position to zero.
Parameters:
[in] iIterations Number of iterations.

Definition at line 63 of file freSetupInterpolator.cxx.

References m_Iterations, and ResetIteration().

Here is the call graph for this function:

FREE::SetupInterpolator::ResetIteration

const int FREE::SetupInterpolator::GetIterations (  ) 

Returns the number of iterations the interpolator will do.

Returns:
Number of iterations.

Definition at line 71 of file freSetupInterpolator.cxx.

References m_Iterations.

const int FREE::SetupInterpolator::GetCurrentIteration (  ) 

Returns the number of the current iteration step.

Returns:
Number of the actual iteration.

Definition at line 76 of file freSetupInterpolator.cxx.

References m_CurrentIteration.

void FREE::SetupInterpolator::ResetIteration (  ) 

Sets the actual iteration step to the beginning.

Definition at line 81 of file freSetupInterpolator.cxx.

References m_CurrentIteration.

Referenced by SetIterations(), SetStartSetup(), SetStopSetup(), and SetupInterpolator().

void FREE::SetupInterpolator::SetSetupName ( const std::string &  sName  ) 

Defines the name of the interpolated setups (with an automatic added suffix). If name is not set, the name of the start setup will be used.

Parameters:
[in] sName Name for the interpolated setups.

Definition at line 86 of file freSetupInterpolator.cxx.

References m_sName.

const std::string FREE::SetupInterpolator::GetSetupName (  ) 

Returns the name of the interpolated setups.

Returns:
std::string containing the name.

Definition at line 91 of file freSetupInterpolator.cxx.

References m_sName.

void FREE::SetupInterpolator::ResetName (  ) 

Resets the name of interpolated setup, so the name of the start setup will be used.

Definition at line 96 of file freSetupInterpolator.cxx.

References m_sName.

Referenced by SetupInterpolator().

Setup::Pointer FREE::SetupInterpolator::InterpolateSetup ( const int  iActIteration,
const int  iIterations 
)

Interpolates a setup from the start and stop setup. The iteration position and count are passed with the function call, so don't consider the settings of the object. The change of the parameters is equal to the difference of start and stop, multiplied by iActIteration/(iIterations+1).

Remarks:
The function creates a new setup to fill in the interpolated values.
Parameters:
[in] iActIteration Number of iteration, which should be calculated.
[in] iIterations Number of iterations.
Returns:
Pointer to the interpolated setup.

Definition at line 101 of file freSetupInterpolator.cxx.

References InterpolateComponent(), m_pStartSetup, m_pStopSetup, m_sName, FREE::Setup::New(), FREE::Setup::SetName(), throwExceptionMacro, and FREE::Convert::ToStr().

Referenced by InterpolateNext(), and InterpolateSetup().

Here is the call graph for this function:

FREE::SetupInterpolator::InterpolateComponentFREE::Setup::NewFREE::Setup::SetNameFREE::Convert::ToStrFREE::ComponentSetup::ComponentsFREE::Setup::GetComponentByIDPathFREE::KeyedCollectionBase::GetElementFREE::ComponentSetup::GetIDPathFREE::ParameterCollection::GetParameterNameFREE::Setup::GetSectionsFREE::SetupInterpolator::InterpolateParameterFREE::ComponentSetup::ParametersFREE::CollectionBase::SizeFREE::ParameterCollection::SizeFREE::KeyedCollectionBase::GetElementIndexFREE::ComponentSetup::HasParentComponentFREE::ComponentSetup::GetComponentIDFREE::ControllerCentral::GetControllerFREE::ComponentSetup::GetControllerIDFREE::ParameterCollection::GetParameterValueFREE::ComponentControllerInterface::GetProfileFREE::ParameterCollection::ParameterExistsFREE::ParameterCollection::ParameterLayerCountFREE::ParameterCollection::ParameterSizeFREE::ParameterCollection::SetParameterValueFREE::ControllerInfo::GetControllerFREE::ControllerCentral::GetControllerInfoFREE::ControllerCentral::InitializeFREE::ControllerCentral::LoadDynamicControllersFREE::ControllerCentral::RegisterDefaultsFREE::GetGeneralFREEPathFREE::ControllerCentral::LoadLibrariesInPathFREE::LogFileController::AddEntryFREE::CreateFullPathFREE::NameIsSharedLibraryFREE::ControllerCentral::RegisterControllerFREE::ControllerCentral::TriggerControlEventFREE::ComponentControllerInterface::ControllerIDFREE::ParameterCollection::GetParameterIndex

Setup::Pointer FREE::SetupInterpolator::InterpolateSetup ( const int  iActIteration  ) 

Interpolates a setup from the start and stop setup. The iteration position is passed with the function call, so don't consider the settings of the object. The change of the parameters is equal to the difference of start and stop, multiplied by iActIteration/m_Iterations.

Remarks:
The function creates a new setup to fill in the interpolated values.
Parameters:
[in] iActIteration Number of iteration, which should be calculated.
Returns:
Pointer to the interpolated setup.

Definition at line 125 of file freSetupInterpolator.cxx.

References InterpolateSetup(), and m_Iterations.

Here is the call graph for this function:

FREE::SetupInterpolator::InterpolateSetupFREE::SetupInterpolator::InterpolateComponentFREE::Setup::NewFREE::Setup::SetNameFREE::Convert::ToStrFREE::ComponentSetup::ComponentsFREE::Setup::GetComponentByIDPathFREE::KeyedCollectionBase::GetElementFREE::ComponentSetup::GetIDPathFREE::ParameterCollection::GetParameterNameFREE::Setup::GetSectionsFREE::SetupInterpolator::InterpolateParameterFREE::ComponentSetup::ParametersFREE::CollectionBase::SizeFREE::ParameterCollection::SizeFREE::KeyedCollectionBase::GetElementIndexFREE::ComponentSetup::HasParentComponentFREE::ComponentSetup::GetComponentIDFREE::ControllerCentral::GetControllerFREE::ComponentSetup::GetControllerIDFREE::ParameterCollection::GetParameterValueFREE::ComponentControllerInterface::GetProfileFREE::ParameterCollection::ParameterExistsFREE::ParameterCollection::ParameterLayerCountFREE::ParameterCollection::ParameterSizeFREE::ParameterCollection::SetParameterValueFREE::ControllerInfo::GetControllerFREE::ControllerCentral::GetControllerInfoFREE::ControllerCentral::InitializeFREE::ControllerCentral::LoadDynamicControllersFREE::ControllerCentral::RegisterDefaultsFREE::GetGeneralFREEPathFREE::ControllerCentral::LoadLibrariesInPathFREE::LogFileController::AddEntryFREE::CreateFullPathFREE::NameIsSharedLibraryFREE::ControllerCentral::RegisterControllerFREE::ControllerCentral::TriggerControlEventFREE::ComponentControllerInterface::ControllerIDFREE::ParameterCollection::GetParameterIndex

Setup::Pointer FREE::SetupInterpolator::InterpolateNext (  ) 

Interpolates the next setup from the set of interpolated setups between the start and stop setup. Calling the function the internal iteration position will be increased, so successively calling the function, will produce a successive setups. The function do not the start or stop setup. If all iterations are made, the function will return NULL.

Remarks:
The function creates a new setup to fill in the interpolated values.
Reset the interaction position by calling ResetIteration(). Changing start setup, stop setup or the iterations, will do this automatically.
Returns:
Pointer to the interpolated setup.

Definition at line 132 of file freSetupInterpolator.cxx.

References InterpolateSetup(), m_CurrentIteration, and m_Iterations.

Here is the call graph for this function:

FREE::SetupInterpolator::InterpolateSetupFREE::SetupInterpolator::InterpolateComponentFREE::Setup::NewFREE::Setup::SetNameFREE::Convert::ToStrFREE::ComponentSetup::ComponentsFREE::Setup::GetComponentByIDPathFREE::KeyedCollectionBase::GetElementFREE::ComponentSetup::GetIDPathFREE::ParameterCollection::GetParameterNameFREE::Setup::GetSectionsFREE::SetupInterpolator::InterpolateParameterFREE::ComponentSetup::ParametersFREE::CollectionBase::SizeFREE::ParameterCollection::SizeFREE::KeyedCollectionBase::GetElementIndexFREE::ComponentSetup::HasParentComponentFREE::ComponentSetup::GetComponentIDFREE::ControllerCentral::GetControllerFREE::ComponentSetup::GetControllerIDFREE::ParameterCollection::GetParameterValueFREE::ComponentControllerInterface::GetProfileFREE::ParameterCollection::ParameterExistsFREE::ParameterCollection::ParameterLayerCountFREE::ParameterCollection::ParameterSizeFREE::ParameterCollection::SetParameterValueFREE::ControllerInfo::GetControllerFREE::ControllerCentral::GetControllerInfoFREE::ControllerCentral::InitializeFREE::ControllerCentral::LoadDynamicControllersFREE::ControllerCentral::RegisterDefaultsFREE::GetGeneralFREEPathFREE::ControllerCentral::LoadLibrariesInPathFREE::LogFileController::AddEntryFREE::CreateFullPathFREE::NameIsSharedLibraryFREE::ControllerCentral::RegisterControllerFREE::ControllerCentral::TriggerControlEventFREE::ComponentControllerInterface::ControllerIDFREE::ParameterCollection::GetParameterIndex

void FREE::SetupInterpolator::InterpolateParameter ( ComponentSetup pInterpolate,
ComponentSetup pStart,
ComponentSetup pStop,
const std::string &  sKey,
const int &  iActIteration,
const int &  iIterations 
) [private]

Interpolates a parameter (defined by the sKey) of a component.

Parameters:
[in,out] pInterpolate Pointer to the component of the interpolated setup.
[in] pStart Pointer to the component of the start setup.
[in] pStop Pointer to the same component of the stop setup.
[in] sKey Key of the parameter to interpolate.
[in] iActIteration Number of iteration, which should be calculated.
[in] iIterations Total number of iterations.

Definition at line 156 of file freSetupInterpolator.cxx.

References FREE::ComponentSetup::GetComponentID(), FREE::ControllerCentral::GetController(), FREE::ComponentSetup::GetControllerID(), FREE::ParameterCollection::GetParameterValue(), FREE::ComponentControllerInterface::GetProfile(), m_Central, FREE::ParameterCollection::ParameterExists(), FREE::ParameterCollection::ParameterLayerCount(), FREE::ComponentSetup::Parameters(), FREE::ParameterCollection::ParameterSize(), FREE::Parameter::PVTDouble, FREE::Parameter::PVTInteger, FREE::Parameter::PVTLong, FREE::Parameter::PVTULong, FREE::ParameterCollection::SetParameterValue(), and throwExceptionMacro.

Referenced by InterpolateComponent().

Here is the call graph for this function:

FREE::ComponentSetup::GetComponentIDFREE::ControllerCentral::GetControllerFREE::ComponentSetup::GetControllerIDFREE::ParameterCollection::GetParameterValueFREE::ComponentControllerInterface::GetProfileFREE::ParameterCollection::ParameterExistsFREE::ParameterCollection::ParameterLayerCountFREE::ComponentSetup::ParametersFREE::ParameterCollection::ParameterSizeFREE::ParameterCollection::SetParameterValueFREE::ControllerInfo::GetControllerFREE::ControllerCentral::GetControllerInfoFREE::ControllerCentral::InitializeFREE::ControllerCentral::LoadDynamicControllersFREE::ControllerCentral::RegisterDefaultsFREE::GetGeneralFREEPathFREE::ControllerCentral::LoadLibrariesInPathFREE::LogFileController::AddEntryFREE::CreateFullPathFREE::NameIsSharedLibraryFREE::ControllerCentral::RegisterControllerFREE::ControllerCentral::TriggerControlEventFREE::ComponentControllerInterface::ControllerIDFREE::ParameterCollection::GetParameterIndex

void FREE::SetupInterpolator::InterpolateComponent ( ComponentSetup pComponent,
const int &  iSectionID,
const int &  iActIteration,
const int &  iIterations 
) [private]

Interpolates a whole component.

Parameters:
[in,out] pComponent Pointer to the component of the interpolated setup.
[in] iSectionID ID of the section, the component belongs to.
[in] iActIteration Number of iteration, which should be calculated.
[in] iIterations Total number of iterations.

Definition at line 197 of file freSetupInterpolator.cxx.

References FREE::ComponentSetup::Components(), FREE::Setup::GetComponentByIDPath(), FREE::KeyedCollectionBase< TKey, TElement, TIdentifierClass >::GetElement(), FREE::ComponentSetup::GetIDPath(), FREE::ParameterCollection::GetParameterName(), FREE::Setup::GetSections(), InterpolateParameter(), m_pStartSetup, m_pStopSetup, FREE::ComponentSetup::Parameters(), FREE::CollectionBase< TElement, TStorageType >::Size(), FREE::ParameterCollection::Size(), and throwExceptionMacro.

Referenced by InterpolateSetup().

Here is the call graph for this function:

FREE::ComponentSetup::ComponentsFREE::Setup::GetComponentByIDPathFREE::KeyedCollectionBase::GetElementFREE::ComponentSetup::GetIDPathFREE::ParameterCollection::GetParameterNameFREE::Setup::GetSectionsFREE::SetupInterpolator::InterpolateParameterFREE::ComponentSetup::ParametersFREE::CollectionBase::SizeFREE::ParameterCollection::SizeFREE::KeyedCollectionBase::GetElementIndexFREE::ComponentSetup::HasParentComponentFREE::ComponentSetup::GetComponentIDFREE::ControllerCentral::GetControllerFREE::ComponentSetup::GetControllerIDFREE::ParameterCollection::GetParameterValueFREE::ComponentControllerInterface::GetProfileFREE::ParameterCollection::ParameterExistsFREE::ParameterCollection::ParameterLayerCountFREE::ParameterCollection::ParameterSizeFREE::ParameterCollection::SetParameterValueFREE::ControllerInfo::GetControllerFREE::ControllerCentral::GetControllerInfoFREE::ControllerCentral::InitializeFREE::ControllerCentral::LoadDynamicControllersFREE::ControllerCentral::RegisterDefaultsFREE::GetGeneralFREEPathFREE::ControllerCentral::LoadLibrariesInPathFREE::LogFileController::AddEntryFREE::CreateFullPathFREE::NameIsSharedLibraryFREE::ControllerCentral::RegisterControllerFREE::ControllerCentral::TriggerControlEventFREE::ComponentControllerInterface::ControllerIDFREE::ParameterCollection::GetParameterIndex


Member Data Documentation

int FREE::SetupInterpolator::m_CurrentIteration [private]

The current iteration step for interpolating a setup

Definition at line 155 of file freSetupInterpolator.h.

Referenced by GetCurrentIteration(), InterpolateNext(), and ResetIteration().

int FREE::SetupInterpolator::m_Iterations [private]

Number of iteration steps for the gradual interpolation from start to stop setup.

Definition at line 158 of file freSetupInterpolator.h.

Referenced by GetIterations(), InterpolateNext(), InterpolateSetup(), SetIterations(), and SetupInterpolator().

std::string FREE::SetupInterpolator::m_sName [private]

Name of the interpolated setups. A suffix will be added automatically, which indicates the iteration.

Definition at line 161 of file freSetupInterpolator.h.

Referenced by GetSetupName(), InterpolateSetup(), ResetName(), SetSetupName(), and SetupInterpolator().

Setup* FREE::SetupInterpolator::m_pStartSetup [private]

Pointer to the start setup.

Definition at line 164 of file freSetupInterpolator.h.

Referenced by GetStartSetup(), InterpolateComponent(), InterpolateSetup(), SetStartSetup(), and SetupInterpolator().

Setup* FREE::SetupInterpolator::m_pStopSetup [private]

Pointer to the stop setup.

Definition at line 167 of file freSetupInterpolator.h.

Referenced by GetStopSetup(), InterpolateComponent(), InterpolateSetup(), SetStopSetup(), and SetupInterpolator().

ControllerCentral FREE::SetupInterpolator::m_Central [private]

Pointer to the central setup.

Definition at line 170 of file freSetupInterpolator.h.

Referenced by InterpolateParameter().


The documentation for this class was generated from the following files:
Generated at Sat Oct 13 18:22:38 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000