An abstract class for tests of evolved individuals. More...

Inheritance diagram for AbstractTest:

Public Slots

virtual void runTest ()=0
 Runs the test. More...
 

Public Member Functions

 AbstractTest ()
 Constructor. More...
 
virtual ~AbstractTest ()
 Destructor. More...
 
EvoRobotComponentcomponent ()
 Returns a pointer to the Component. More...
 
virtual void configure (ConfigurationParameters &, QString)
 Configures the object using a ConfigurationParameters object. More...
 
QString iconFilename ()
 the filename of the icon to show on the menu/toolbar More...
 
QString menuText ()
 the text to show on the menu/toolbar More...
 
virtual void postConfigureInitialization ()
 This function is called after all linked objects have been configured. More...
 
virtual void save (ConfigurationParameters &params, QString prefix)
 Save the actual status of parameters into the ConfigurationParameters object passed. More...
 
virtual void setComponent (EvoRobotComponent *component)
 Sets the Component. More...
 
QString tooltip ()
 the tooltip text to show on the menu/toolbar More...
 
- Public Member Functions inherited from ParameterSettable
void addObserver (RuntimeParameterObserver *obs)
 
getRuntimeParameter (QString paramName)
 
virtual ParameterSettableUIgetUIManager ()
 
void removeObserver (RuntimeParameterObserver *obs)
 
void setRuntimeParameter (QString paramName, T newvalue)
 
QString typeName () const
 

Static Public Member Functions

static void describe (QString type)
 Describe Function. More...
 
- 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 More...
 
QString m_menuText
 change in in subclasses for setting the text will appear on the menu/toolbar More...
 
QString m_tooltip
 change in in subclasses for setting the tooltip will appear on the menu/toolbar More...
 

Additional Inherited Members

- Public Types inherited from ParameterSettable
enum  Property
 
- Public Attributes inherited from ParameterSettable
 AllowMultiple
 
 Default
 
 IsList
 
 IsMandatory
 
- Static Public Attributes inherited from ParameterSettable
static const double Infinity
 
static const int MaxInteger
 
static const int MinInteger
 
- Protected Member Functions inherited from ParameterSettable
void notifyChangesToParam (QString paramName)
 
- Static Protected Member Functions inherited from ParameterSettable
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

AbstractTest ( )
inline

Constructor.

Definition at line 58 of file abstracttest.h.

virtual ~AbstractTest ( )
inlinevirtual

Destructor.

Definition at line 71 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 137 of file abstracttest.h.

Referenced by TestRandom::buildRandomDNA(), TestRandom::runTest(), TestIndividual::runTest(), TestCurrent::runTest(), and TestIndividual::setPopulationToTest().

virtual void configure ( ConfigurationParameters ,
QString   
)
inlinevirtual

Configures the object using a ConfigurationParameters object.

Parameters
paramsthe configuration parameters object with parameters to use
prefixthe 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 TestCurrent, TestIndividual, and TestRandom.

Definition at line 85 of file abstracttest.h.

Referenced by TestRandom::configure(), TestIndividual::configure(), and TestCurrent::configure().

static void describe ( QString  type)
inlinestatic

Describe Function.

Definition at line 105 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 162 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 146 of file abstracttest.h.

Referenced by EvoRobotViewer::addAdditionalMenus(), and TestOperation::run().

virtual void postConfigureInitialization ( )
inlinevirtual

This function is called after all linked objects have been configured.

Reimplemented from ParameterSettable.

Definition at line 113 of file abstracttest.h.

virtual void runTest ( )
pure virtualslot

Runs the test.

Implemented in TestCurrent, TestIndividual, and TestRandom.

Referenced by TestOperation::run(), and EvoRobotComponent::runTest().

virtual void save ( ConfigurationParameters params,
QString  prefix 
)
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
paramsthe configuration parameters object on which save actual parameters
prefixthe prefix to use to access the object configuration parameters.

Implements ParameterSettable.

Reimplemented in TestCurrent, TestIndividual, and TestRandom.

Definition at line 99 of file abstracttest.h.

References ConfigurationParameters::startObjectParameters().

Referenced by TestRandom::save(), TestIndividual::save(), and TestCurrent::save().

virtual void setComponent ( EvoRobotComponent component)
inlinevirtual

Sets the Component.

We need it to obtain all the data for the test: the experiment object, genotype loading, and so on.

Parameters
componenta 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().

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 154 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 177 of file abstracttest.h.

Referenced by TestCurrent::TestCurrent(), 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 173 of file abstracttest.h.

Referenced by TestCurrent::TestCurrent(), 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 175 of file abstracttest.h.

Referenced by TestCurrent::TestCurrent(), TestIndividual::TestIndividual(), and TestRandom::TestRandom().


The documentation for this class was generated from the following file: