12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- /// @file optimization/SimpleOptTestGrid.h
- /// @author Matthias Wacker
- /// @date
- ///
- ///
- ///
- ///
- #ifndef _SIMPLEOPTTESTGRID_H_
- #define _SIMPLEOPTTESTGRID_H_
- #include "Opt_Namespace.h"
- #include "SimpleOptimizer.h"
- #include "SimpleOptProblem.h"
- #include <vector>
- namespace opt=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 opt::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<opt::matrix_type> m_vSolutions;
- /// the success distances
- std::vector<double> m_vSuccessDistances;
- /// number of Problems
- int m_iNumberOfProblems;
- };
- #endif // _SIMPLEOPTTESTGRID_H_
|