An abstract class for tests of evolved individuals. More...
Public Slots | |
virtual void | runTest ()=0 |
Runs the test. | |
Public Member Functions | |
AbstractTest () | |
Constructor. | |
virtual | ~AbstractTest () |
Destructor. | |
EvoRobotComponent * | component () |
Returns a pointer to the Component. | |
virtual void | configure (ConfigurationParameters &, QString) |
Configures the object using a ConfigurationParameters object. | |
QString | iconFilename () |
the filename of the icon to show on the menu/toolbar | |
QString | menuText () |
the text to show on the menu/toolbar | |
virtual void | postConfigureInitialization () |
This function is called after all linked objects have been configured. | |
virtual void | save (ConfigurationParameters ¶ms, QString prefix) |
Save the actual status of parameters into the ConfigurationParameters object passed. | |
virtual void | setComponent (EvoRobotComponent *component) |
Sets the Component. | |
QString | tooltip () |
the tooltip text to show on the menu/toolbar | |
Public Member Functions inherited from ParameterSettableWithConfigureFunction | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
virtual ParameterSettableUI * | getUIManager () |
ParameterSettable () | |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
Public Member Functions inherited from ParameterSettable | |
void | addObserver (RuntimeParameterObserver *obs) |
T | getRuntimeParameter (QString paramName) |
void | removeObserver (RuntimeParameterObserver *obs) |
void | setRuntimeParameter (QString paramName, T newvalue) |
QString | typeName () const |
Static Public Member Functions | |
static void | describe (QString type) |
Describe Function. | |
Static Public Member Functions inherited from ParameterSettableWithConfigureFunction | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
Static Public Member Functions inherited from ParameterSettable | |
static void | describe (QString type) |
static QString | fullParameterDescriptionPath (QString type, QString param) |
static QString | fullSubgroupDescriptionPath (QString type, QString sub) |
Protected Attributes | |
QString | m_iconFilename |
change in in subclasses for setting the icon will appear on the menu/toolbar | |
QString | m_menuText |
change in in subclasses for setting the text will appear on the menu/toolbar | |
QString | m_tooltip |
change in in subclasses for setting the tooltip will appear on the menu/toolbar | |
Additional Inherited Members | |
Public Types inherited from ParameterSettableWithConfigureFunction | |
enum | Property |
Public Attributes inherited from ParameterSettableWithConfigureFunction | |
AllowMultiple | |
Default | |
IsList | |
IsMandatory | |
Static Public Attributes inherited from ParameterSettableWithConfigureFunction | |
static const double | Infinity |
static const int | MaxInteger |
static const int | MinInteger |
Protected Member Functions inherited from ParameterSettableWithConfigureFunction | |
void | notifyChangesToParam (QString paramName) |
Static Protected Member Functions inherited from ParameterSettableWithConfigureFunction | |
static Descriptor | addTypeDescription (QString type, QString shortHelp, QString longHelp=QString("")) |
static void | setGraphicalEditor (QString type) |
Detailed Description
An abstract class for tests of evolved individuals.
This is the abstract class for those performing tests on evolved individuals. The main function is runTest(), which is pure virtual. This function is the one that gets executed when a test is requested. The configure and postConfigureInitialization functions have an empty implementaion, while the save implementation simply prints an error message and causes an abort. When writing subclasses, ALWAYS remember to register the class with the factory, so that it can be instantiated when needed.
Definition at line 50 of file abstracttest.h.
Constructor & Destructor Documentation
|
inline |
Constructor.
Definition at line 58 of file abstracttest.h.
|
inlinevirtual |
Destructor.
Definition at line 71 of file abstracttest.h.
Member Function Documentation
|
inline |
Returns a pointer to the Component.
Use it in subclasses for get all the data necessary for implementing the test
- Returns
- a pointer to the EvoRobotComponent
- Warning
- this hierarchy of class for testing works only with EvoRobotComponent
Definition at line 137 of file abstracttest.h.
Referenced by TestRandom::buildRandomDNA(), TestRandom::runTest(), TestIndividual::runTest(), and TestIndividual::setPopulationToTest().
|
inlinevirtual |
Configures the object using a ConfigurationParameters object.
- Parameters
-
params the configuration parameters object with parameters to use prefix the prefix to use to access the object configuration parameters. This is guaranteed to end with the separator character when called by the factory, so you don't need to add one
Implements ParameterSettableWithConfigureFunction.
Reimplemented in TestIndividual, and TestRandom.
Definition at line 85 of file abstracttest.h.
Referenced by TestRandom::configure(), and TestIndividual::configure().
|
inlinestatic |
Describe Function.
Definition at line 105 of file abstracttest.h.
|
inline |
the filename of the icon to show on the menu/toolbar
Subclasses can change the protected variable m_iconFilename in order to customize it
Definition at line 162 of file abstracttest.h.
Referenced by EvoRobotViewer::addAdditionalMenus().
|
inline |
the text to show on the menu/toolbar
Subclasses can change the protected variable m_menuText in order to customize it
Definition at line 146 of file abstracttest.h.
Referenced by EvoRobotViewer::addAdditionalMenus(), and TestOperation::run().
|
inlinevirtual |
This function is called after all linked objects have been configured.
Reimplemented from ParameterSettableWithConfigureFunction.
Definition at line 113 of file abstracttest.h.
|
pure virtualslot |
Runs the test.
Implemented in TestIndividual, and TestRandom.
Referenced by TestOperation::run(), and EvoRobotComponent::runTest().
|
inlinevirtual |
Save the actual status of parameters into the ConfigurationParameters object passed.
This is not implemented, a call to this function will cause an abort
- Parameters
-
params the configuration parameters object on which save actual parameters prefix the prefix to use to access the object configuration parameters.
Implements ParameterSettableWithConfigureFunction.
Reimplemented in TestIndividual, and TestRandom.
Definition at line 99 of file abstracttest.h.
References ConfigurationParameters::startObjectParameters().
Referenced by TestRandom::save(), and TestIndividual::save().
|
inlinevirtual |
Sets the Component.
We need it to obtain all the data for the test: the experiment object, genotype loading, and so on.
- Parameters
-
component a pointer to the EvoRobotComponent
- Warning
- this hierarchy of class for testing works only with EvoRobotComponent
Definition at line 125 of file abstracttest.h.
Referenced by EvoRobotComponent::configure().
|
inline |
the tooltip text to show on the menu/toolbar
Subclasses can change the protected variable m_tooltip in order to customize it
Definition at line 154 of file abstracttest.h.
Referenced by EvoRobotViewer::addAdditionalMenus().
Member Data Documentation
|
protected |
change in in subclasses for setting the icon will appear on the menu/toolbar
Definition at line 177 of file abstracttest.h.
Referenced by TestIndividual::TestIndividual(), and TestRandom::TestRandom().
|
protected |
change in in subclasses for setting the text will appear on the menu/toolbar
Definition at line 173 of file abstracttest.h.
Referenced by TestIndividual::TestIndividual(), and TestRandom::TestRandom().
|
protected |
change in in subclasses for setting the tooltip will appear on the menu/toolbar
Definition at line 175 of file abstracttest.h.
Referenced by TestIndividual::TestIndividual(), and TestRandom::TestRandom().
The documentation for this class was generated from the following file:
- experiments/evorobot/include/abstracttest.h