AbstractTest Class Reference
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 | |
Static Public Member Functions | |
static void | describe (QString type) |
Describe Function. | |
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 |
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 51 of file abstracttest.h.
Constructor & Destructor Documentation
AbstractTest | ( | ) | [inline] |
Constructor.
Definition at line 59 of file abstracttest.h.
virtual ~AbstractTest | ( | ) | [inline, virtual] |
Destructor.
Definition at line 72 of file abstracttest.h.
Member Function Documentation
EvoRobotComponent* component | ( | ) | [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 138 of file abstracttest.h.
Referenced by TestRandom::buildRandomDNA(), TestIndividual::runTest(), TestRandom::runTest(), and TestIndividual::setPopulationToTest().
virtual void configure | ( | ConfigurationParameters & | , |
QString | |||
) | [inline, virtual] |
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 TestRandom, and TestIndividual.
Definition at line 86 of file abstracttest.h.
static void describe | ( | QString | type | ) | [inline, static] |
Describe Function.
Reimplemented from ParameterSettable.
Reimplemented in TestRandom, and TestIndividual.
Definition at line 106 of file abstracttest.h.
QString iconFilename | ( | ) | [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 163 of file abstracttest.h.
Referenced by EvoRobotViewer::addAdditionalMenus().
QString menuText | ( | ) | [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 147 of file abstracttest.h.
Referenced by EvoRobotViewer::addAdditionalMenus(), and TestOperation::run().
virtual void postConfigureInitialization | ( | ) | [inline, virtual] |
This function is called after all linked objects have been configured.
Reimplemented from ParameterSettable.
Definition at line 114 of file abstracttest.h.
virtual void runTest | ( | ) | [pure virtual, slot] |
Runs the test.
Implemented in TestRandom, and TestIndividual.
Referenced by TestOperation::run(), and EvoRobotComponent::runTest().
virtual void save | ( | ConfigurationParameters & | params, |
QString | prefix | ||
) | [inline, virtual] |
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 ParameterSettable.
Reimplemented in TestRandom, and TestIndividual.
Definition at line 100 of file abstracttest.h.
References ConfigurationParameters::startObjectParameters().
virtual void setComponent | ( | EvoRobotComponent * | component | ) | [inline, virtual] |
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 126 of file abstracttest.h.
Referenced by EvoRobotComponent::configure().
QString tooltip | ( | ) | [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 155 of file abstracttest.h.
Referenced by EvoRobotViewer::addAdditionalMenus().
Member Data Documentation
QString m_iconFilename [protected] |
change in in subclasses for setting the icon will appear on the menu/toolbar
Definition at line 178 of file abstracttest.h.
Referenced by TestIndividual::TestIndividual(), and TestRandom::TestRandom().
QString m_menuText [protected] |
change in in subclasses for setting the text will appear on the menu/toolbar
Definition at line 174 of file abstracttest.h.
Referenced by TestIndividual::TestIndividual(), and TestRandom::TestRandom().
QString m_tooltip [protected] |
change in in subclasses for setting the tooltip will appear on the menu/toolbar
Definition at line 176 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