123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- /// @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 <vector>
- 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<SimpleOptimizer*> getOptimizers() const {return m_vSimpleOptimzers;};
-
- private:
- /// the optimizers
- std::vector<SimpleOptimizer*> m_vSimpleOptimzers;
-
- /// number of optimizers
- int m_iNumberOfOptimizers;
- /// the problems
- std::vector<SimpleOptProblem> m_vSimpleOptProblem;
- /// the solutions
- std::vector<OPTIMIZATION::matrix_type> m_vSolutions;
- /// the success distances
- std::vector<double> m_vSuccessDistances;
- /// number of Problems
- int m_iNumberOfProblems;
- }; //class
- }//namespace
- #endif // _SIMPLEOPTTESTGRID_H_
|