/// @file optimization/SimpleOptTestGrid.h /// @author Matthias Wacker /// @date /// /// /// /// #ifndef _SIMPLEOPTTESTGRID_H_ #define _SIMPLEOPTTESTGRID_H_ #include "Opt_Namespace.h" #include "core/optimization/blackbox/SimpleOptimizer.h" #include "core/optimization/blackbox/SimpleOptProblem.h" #include namespace OPTIMIZATION { /// /// @class SimpleOptTestGrid defines a class to test simpleOptimizer(s) with SimpleOptProblem(s) /// /// gets a number of ploblems and a number of optimizers and tries to solve every problem with each optimizer /// class SimpleOptTestGrid { public: /// /// Default Constructor /// SimpleOptTestGrid(); /// /// Default Destructor /// ~SimpleOptTestGrid(); /// /// adds a SimpleOptProb to the optimizer /// /// @param optProb the optProb to test (is copied in this routine -> only works with deep copy implemented copy constructors!) /// @param solution the solution to the problem /// @param successDist the maximum distance to the solution that is considered as success /// void addSimpleOptProblem( const SimpleOptProblem & optProb, const OPTIMIZATION::matrix_type &solution, double successDist); /// /// adds a SimpleOptimizer /// /// @param opt the optimizer (already configured!!) /// void addSimpleOptimizer(SimpleOptimizer *opt); /// /// runs the tests on the test grid /// /// @return true in case of a full success, false in case of at least 1 failed test case /// bool test(); /// /// runs a specific test /// /// @param optIdx index of the optimizer (starting with 0) /// @param probIdx index of the problem (starting with 0) /// bool test(int optIdx, int probIdx); /// /// get optimizers /// std::vector getOptimizers() const {return m_vSimpleOptimzers;}; private: /// the optimizers std::vector m_vSimpleOptimzers; /// number of optimizers int m_iNumberOfOptimizers; /// the problems std::vector m_vSimpleOptProblem; /// the solutions std::vector m_vSolutions; /// the success distances std::vector m_vSuccessDistances; /// number of Problems int m_iNumberOfProblems; }; //class }//namespace #endif // _SIMPLEOPTTESTGRID_H_