Evoplex
0.2.1
|
Provides a common interface for Model plugins. More...
#include <abstractmodel.h>
Public Member Functions | |
virtual | ~AbstractModelInterface ()=default |
Provide a default destructor to keep compilers happy. | |
virtual void | beforeLoop ()=0 |
It is executed before the algorithmStep() loop. More... | |
virtual bool | algorithmStep ()=0 |
It is executed in a loop and must contain all the logic to perform ONE step. More... | |
virtual void | afterLoop ()=0 |
It is executed after the algorithmStep() loop ends. More... | |
virtual Values | customOutputs (const Values &inputs) const =0 |
Allows implementing custom outputs for the model plugin. More... | |
virtual bool | init () |
Initializes the plugin. More... | |
Public Member Functions inherited from evoplex::AbstractPlugin | |
virtual bool | init () |
Initializes the plugin. More... | |
PRG * | prg () const |
pseudo-random generator pointer. More... | |
PRG * | rand () const |
prg() alias More... | |
const Attributes * | attrs () const |
Gets the plugin's attributes. | |
const QString & | attrName (int attrId) const |
Gets the attribute's name for attrId . More... | |
const Value & | attr (int attrId) const |
Gets the attribute's value for attrId . More... | |
Value | attr (const QString &name, Value defaultValue=Value()) const |
Gets the value of the attribute name . More... | |
bool | attrExists (const char *name) const |
Checks if the plugin's attribute name exists. More... | |
bool | attrExists (const QString &name) const |
Checks if the plugin's attribute name exists. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from evoplex::AbstractPlugin | |
AbstractPlugin ()=default | |
constructor | |
~AbstractPlugin ()=default | |
destructor | |
Protected Attributes inherited from evoplex::AbstractPlugin | |
Trial * | m_trial |
Provides a common interface for Model plugins.
|
pure virtual |
It is executed after the algorithmStep() loop ends.
The default implementation of this function does nothing.
Implemented in evoplex::AbstractModel.
|
pure virtual |
It is executed in a loop and must contain all the logic to perform ONE step.
|
pure virtual |
It is executed before the algorithmStep() loop.
The default implementation of this function does nothing.
Implemented in evoplex::AbstractModel.
|
pure virtual |
Allows implementing custom outputs for the model plugin.
A "custom output" can be plotted or stored in a file through Evoplex. The inputs
must be defined in the metadata.json file. If an experiment requests some custom output, this function will be called once at each time step, receiving the requested inputs
. The default implementation of this function does nothing.
inputs
Implemented in evoplex::AbstractModel.
virtual bool evoplex::AbstractPlugin::init |
Initializes the plugin.
This method is called when the plugin is created and is mainly used to validate inputs and set the environment. The default implementation does nothing.