#include <freSetupInterpolator.h>

Public Member Functions | |
| virtual const char * | GetNameOfClass () const |
| void | SetStartSetup (Setup *pSetup) |
| Setup * | GetStartSetup () |
| void | SetStopSetup (Setup *pSetup) |
| Setup * | GetStopSetup () |
| 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 |
| Setup * | m_pStartSetup |
| Setup * | m_pStopSetup |
| ControllerCentral | m_Central |
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.
| FREE::SetupInterpolator::SetupInterpolator | ( | ) |
Definition at line 141 of file freSetupInterpolator.cxx.
References m_Iterations, m_pStartSetup, m_pStopSetup, m_sName, ResetIteration(), and ResetName().

| FREE::SetupInterpolator::~SetupInterpolator | ( | ) |
Definition at line 152 of file freSetupInterpolator.cxx.
| 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.
| [in] | pSetup | Pointer to the starting setup. |
Definition at line 37 of file freSetupInterpolator.cxx.
References m_pStartSetup, and ResetIteration().

| Setup * FREE::SetupInterpolator::GetStartSetup | ( | ) |
Returns the pointer to the current starting setup for the interpolation.
Definition at line 45 of file freSetupInterpolator.cxx.
References m_pStartSetup.
| void FREE::SetupInterpolator::SetStopSetup | ( | Setup * | pSetup | ) |
Defines the stopping setup for the interpolation.
| [in] | pSetup | Pointer to the stopping setup. |
Definition at line 50 of file freSetupInterpolator.cxx.
References m_pStopSetup, and ResetIteration().

| Setup * FREE::SetupInterpolator::GetStopSetup | ( | ) |
Returns the pointer to the current stopping setup for the interpolation.
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.
| [in] | iIterations | Number of iterations. |
Definition at line 63 of file freSetupInterpolator.cxx.
References m_Iterations, and ResetIteration().

| const int FREE::SetupInterpolator::GetIterations | ( | ) |
Returns the number of iterations the interpolator will do.
Definition at line 71 of file freSetupInterpolator.cxx.
References m_Iterations.
| const int FREE::SetupInterpolator::GetCurrentIteration | ( | ) |
Returns the number of the current iteration step.
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.
| [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.
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).
| [in] | iActIteration | Number of iteration, which should be calculated. |
| [in] | iIterations | Number of iterations. |
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().

| 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.
| [in] | iActIteration | Number of iteration, which should be calculated. |
Definition at line 125 of file freSetupInterpolator.cxx.
References InterpolateSetup(), and m_Iterations.

| 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.
Definition at line 132 of file freSetupInterpolator.cxx.
References InterpolateSetup(), m_CurrentIteration, and m_Iterations.

| 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.
| [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().

| void FREE::SetupInterpolator::InterpolateComponent | ( | ComponentSetup * | pComponent, | |
| const int & | iSectionID, | |||
| const int & | iActIteration, | |||
| const int & | iIterations | |||
| ) | [private] |
Interpolates a whole component.
| [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().

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().
Pointer to the central setup.
Definition at line 170 of file freSetupInterpolator.h.
Referenced by InterpolateParameter().
1.5.3 written by Dimitri van Heesch,
© 1997-2000