Collection of an extensible set of options for a multi-objective experiment. More...
#include <shark/Algorithms/DirectSearch/Experiments/Experiment.h>
Inheritance diagram for shark::ExperimentBase::Options:
Collaboration diagram for shark::ExperimentBase::Options:Public Member Functions | |
| virtual | ~Options () |
| Virtual d'tor. More... | |
| template<typename Tag > | |
| Tag::type | value (const Tag &t) |
| Reads the value of the option specified by the tag. More... | |
| template<typename Tag > | |
| bool | hasValue (const Tag &t) |
| Checks whether the option specified by tag has been parsed. More... | |
| template<typename Tag > | |
| void | addOption (const Tag &t) |
| Adds the supplied option tag. More... | |
| bool | parse (int argc, char **argv) |
| Parses the command line. More... | |
| virtual void | addDefaultOptions () |
| Inserts default options of the experiment. More... | |
| template<typename Stream > | |
| void | printOptions (Stream &s) const |
| Outputs the configured options to the supplied stream. More... | |
| DEFINE_OPTION (ObjectiveFunctionTag, objectiveFunction, std::string,"") | |
| Name of the objective function, passed to factory. More... | |
| DEFINE_OPTION (SeedTag, seed, unsigned int, 1) | |
| Seed for the RNG. More... | |
| DEFINE_OPTION (StorageIntervalTag, storageInterval, unsigned int, 100) | |
| Storage frequency for optimizer results. More... | |
| DEFINE_OPTION (SearchSpaceDimensionTag, searchSpaceDimension, unsigned int, 10) | |
| Dimension of the search space. More... | |
| DEFINE_OPTION (MaxNoEvaluationsTag, maxNoEvaluations, unsigned int, 50000) | |
| Termination criterion, maximum number of evaluations. More... | |
| DEFINE_OPTION (TimeLimitTag, timeLimit, unsigned int, 1000) | |
| Termination criterion, maximum runtime in hours. More... | |
| DEFINE_OPTION (FitnessLimitTag, fitnessLimit, double, 1E-10) | |
| Termination criterion, fitness limit. More... | |
| DEFINE_OPTION (ResultDirTag, resultDir, std::string,".") | |
| Directory to place results in. More... | |
| DEFINE_OPTION (AlgorithmConfigFile, algorithmConfigFile, std::string,"") | |
| Configuration file for the optimizer, JSON syntax. More... | |
| DEFINE_OPTION (ResultFormatTag, resultFormat, std::string,"JSON") | |
| Result format, either JSON or RawText. More... | |
| DEFINE_SIMPLE_OPTION (AlgorithmUsageTag, algorithmUsage) | |
| Reports configuration options of the optimizer. More... | |
| DEFINE_SIMPLE_OPTION (DefaultAlgorithmUsageTag, defaultAlgorithmUsage) | |
| Generates default algorithm configuration file in JSON syntax. More... | |
Protected Attributes | |
| boost::program_options::options_description | m_options |
| Stores known options. More... | |
| boost::program_options::variables_map | m_variablesMap |
| Stores parsed options. More... | |
Collection of an extensible set of options for a multi-objective experiment.
Definition at line 85 of file Experiment.h.
|
inlinevirtual |
Virtual d'tor.
Definition at line 94 of file Experiment.h.
|
inlinevirtual |
Inserts default options of the experiment.
Reimplemented in shark::moo::Experiment::Options.
Definition at line 168 of file Experiment.h.
References addOption().
Referenced by shark::moo::Experiment::Options::addDefaultOptions(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::main().
|
inline |
Adds the supplied option tag.
| Tag | Tag structure. Needs to provide:
|
Definition at line 134 of file Experiment.h.
References m_options.
Referenced by addDefaultOptions(), shark::moo::Experiment::Options::addDefaultOptions(), main(), shark::moo::InterruptibleAlgorithmRunner< Algo, Function >::main(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::main().
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | ObjectiveFunctionTag | , |
| objectiveFunction | , | ||
| std::string | , | ||
| "" | |||
| ) |
Name of the objective function, passed to factory.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | SeedTag | , |
| seed | , | ||
| unsigned | int, | ||
| 1 | |||
| ) |
Seed for the RNG.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | StorageIntervalTag | , |
| storageInterval | , | ||
| unsigned | int, | ||
| 100 | |||
| ) |
Storage frequency for optimizer results.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | SearchSpaceDimensionTag | , |
| searchSpaceDimension | , | ||
| unsigned | int, | ||
| 10 | |||
| ) |
Dimension of the search space.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | MaxNoEvaluationsTag | , |
| maxNoEvaluations | , | ||
| unsigned | int, | ||
| 50000 | |||
| ) |
Termination criterion, maximum number of evaluations.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | TimeLimitTag | , |
| timeLimit | , | ||
| unsigned | int, | ||
| 1000 | |||
| ) |
Termination criterion, maximum runtime in hours.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | FitnessLimitTag | , |
| fitnessLimit | , | ||
| double | , | ||
| 1E- | 10 | ||
| ) |
Termination criterion, fitness limit.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | ResultDirTag | , |
| resultDir | , | ||
| std::string | , | ||
| "." | |||
| ) |
Directory to place results in.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | AlgorithmConfigFile | , |
| algorithmConfigFile | , | ||
| std::string | , | ||
| "" | |||
| ) |
Configuration file for the optimizer, JSON syntax.
| shark::ExperimentBase::Options::DEFINE_OPTION | ( | ResultFormatTag | , |
| resultFormat | , | ||
| std::string | , | ||
| "JSON" | |||
| ) |
Result format, either JSON or RawText.
| shark::ExperimentBase::Options::DEFINE_SIMPLE_OPTION | ( | AlgorithmUsageTag | , |
| algorithmUsage | |||
| ) |
Reports configuration options of the optimizer.
| shark::ExperimentBase::Options::DEFINE_SIMPLE_OPTION | ( | DefaultAlgorithmUsageTag | , |
| defaultAlgorithmUsage | |||
| ) |
Generates default algorithm configuration file in JSON syntax.
|
inline |
Checks whether the option specified by tag has been parsed.
| Tag | Tag structure. Needs to provide:
|
Definition at line 120 of file Experiment.h.
References m_variablesMap.
Referenced by main(), shark::moo::InterruptibleAlgorithmRunner< Algo, Function >::main(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::main().
|
inline |
Parses the command line.
Definition at line 155 of file Experiment.h.
References m_options, and m_variablesMap.
Referenced by main(), shark::moo::InterruptibleAlgorithmRunner< Algo, Function >::main(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::main().
|
inline |
Outputs the configured options to the supplied stream.
| Stream | Type of thream, needs to provide operator<<. |
| [in,out] | s | Instance of the stream. |
Definition at line 189 of file Experiment.h.
References m_options.
Referenced by shark::moo::InterruptibleAlgorithmRunner< Algo, Function >::main(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::main().
|
inline |
Reads the value of the option specified by the tag.
| Tag | Tag structure. Needs to provide:
|
Definition at line 106 of file Experiment.h.
References m_variablesMap.
Referenced by main(), shark::moo::InterruptibleAlgorithmRunner< Algo, Function >::main(), and shark::soo::InterruptibleAlgorithmRunner< Algo, Function >::main().
|
protected |
Stores known options.
Definition at line 88 of file Experiment.h.
Referenced by addOption(), parse(), and printOptions().
|
protected |
Stores parsed options.
Definition at line 90 of file Experiment.h.
Referenced by hasValue(), parse(), and value().