Executes one trial of a single-objective optimizer for a given single-objective fitness function. More...
#include <shark/Algorithms/DirectSearch/InterruptibleAlgorithmRunner.h>
Collaboration diagram for shark::soo::InterruptibleAlgorithmRunner< Algo, Function >:Classes | |
| struct | ResultMetaData |
| Metadata describing actual result data. More... | |
Public Member Functions | |
| InterruptibleAlgorithmRunner (boost::shared_ptr< Algo > algo=boost::shared_ptr< Algo >(new Algo), boost::shared_ptr< Function > function=boost::shared_ptr< Function >(new Function())) | |
| C'tor. More... | |
| event_type & | signalResultsAvailable () |
| Triggered when new results are available. More... | |
| void | run (unsigned int seed, unsigned int interval, unsigned int n, unsigned int g, unsigned int timeLimit, double fitnessLimit=1E-10, const boost::optional< boost::property_tree::ptree > &configNode=boost::optional< boost::property_tree::ptree >()) |
| Executes the optimizer trial for the given parameters. More... | |
| DEFINE_SIMPLE_OPTION (ReportFitnessFunctionsTag, reportFitnessFunctions) | |
| Reports known fitness functions. More... | |
Static Public Member Functions | |
| static int | main (int argc, char **argv) |
Protected Member Functions | |
| void | signalTrap (SignalTrap::SignalType signal) |
| Slot that is called when a signal is emitted from the signal trap. Stores the current front. More... | |
Protected Attributes | |
| result_type | m_result |
| Stores the current front. More... | |
| boost::shared_ptr< Algo > | mep_algorithm |
| Reference to the optimizer. More... | |
| boost::shared_ptr< Function > | mep_function |
| Reference to the objective function. More... | |
| std::string | m_algoName |
| Stores the name of the optimizer. More... | |
| std::string | m_functionName |
| Stores the name of the objective function. More... | |
| std::size_t | m_seed |
| Stores the initial seed of the trial. More... | |
| std::size_t | m_n |
| Stores the dimension of the search space n. More... | |
| boost::timer | m_pt |
| Timer instance for time-limited experiments. More... | |
| double | m_fitnessLimit |
| Target fitness function value. More... | |
| event_type | m_signalResultsAvailable |
| Signal for delivering results to the outside world. More... | |
Executes one trial of a single-objective optimizer for a given single-objective fitness function.
| Algo | Models the type of the optimizer. |
| Function | Models the type of the objective function. |
Definition at line 422 of file InterruptibleAlgorithmRunner.h.
|
inline |
C'tor.
Definition at line 480 of file InterruptibleAlgorithmRunner.h.
References shark::Singleton< SignalTrap >::instance(), and shark::SignalTrap::signalTrapped().
| shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::DEFINE_SIMPLE_OPTION | ( | ReportFitnessFunctionsTag | , |
| reportFitnessFunctions | |||
| ) |
Reports known fitness functions.
|
inlinestatic |
Definition at line 573 of file InterruptibleAlgorithmRunner.h.
References shark::ExperimentBase::Options::addDefaultOptions(), shark::ExperimentBase::Options::addOption(), shark::Logger::DEBUG_LEVEL, shark::OptimizerTraits< Optimizer >::defaultConfig(), shark::Exception::file(), shark::ExperimentBase::Options::hasValue(), shark::Factory< ClassType, TagType >::instance(), shark::Exception::line(), shark::Shark::logger(), shark::ExperimentBase::Options::parse(), shark::ExperimentBase::Options::printOptions(), SHARK_LOG_DEBUG, SHARK_LOG_ERROR, shark::ExperimentBase::Options::value(), and shark::Exception::what().
|
inline |
Executes the optimizer trial for the given parameters.
Definition at line 496 of file InterruptibleAlgorithmRunner.h.
References shark::Shark::logger(), shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_algoName, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_functionName, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_n, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_pt, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_result, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_seed, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_signalResultsAvailable, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::mep_algorithm, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::mep_function, and SHARK_LOG_DEBUG.
|
inline |
Triggered when new results are available.
Definition at line 490 of file InterruptibleAlgorithmRunner.h.
References shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_signalResultsAvailable.
|
inlineprotected |
Slot that is called when a signal is emitted from the signal trap. Stores the current front.
| [in] | signal | The emitted signal |
Definition at line 747 of file InterruptibleAlgorithmRunner.h.
References shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_algoName, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_functionName, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_n, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_pt, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_result, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_seed, shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::m_signalResultsAvailable, and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::mep_function.
|
protected |
Stores the name of the optimizer.
Definition at line 709 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Target fitness function value.
Definition at line 734 of file InterruptibleAlgorithmRunner.h.
|
protected |
Stores the name of the objective function.
Definition at line 714 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Stores the dimension of the search space n.
Definition at line 724 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Timer instance for time-limited experiments.
Definition at line 729 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Stores the current front.
Definition at line 694 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Stores the initial seed of the trial.
Definition at line 719 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Signal for delivering results to the outside world.
Definition at line 739 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalResultsAvailable(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().
|
protected |
Reference to the optimizer.
Definition at line 699 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run().
|
protected |
Reference to the objective function.
Definition at line 704 of file InterruptibleAlgorithmRunner.h.
Referenced by shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::run(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::signalTrap().