Main MRPT website > C++ reference for MRPT 1.9.9
CMultiObjMotionOpt_Scalarization.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 namespace mrpt
14 {
15 namespace nav
16 {
17 /** Implementation of multi-objective motion chooser using scalarization: a
18  * user-given formula is used to
19  * collapse all the scores into a single scalar score. The candidate with the
20  * highest positive score is selected.
21  * Note that assert expressions are honored via the base class
22  * CMultiObjectiveMotionOptimizerBase
23  *
24  * \sa CReactiveNavigationSystem, CReactiveNavigationSystem3D
25  * \ingroup nav_reactive
26  */
29 {
31 
32  public:
34 
35  void loadConfigFile(const mrpt::utils::CConfigFileBase& c) override;
36  void saveConfigFile(mrpt::utils::CConfigFileBase& c) const override;
37 
38  struct TParams
40  {
41  /** A formula that takes all/a subset of scores and generates a scalar
42  * global score. */
44 
45  TParams();
46  void loadFromConfigFile(
48  const std::string& section) override; // See base docs
49  void saveToConfigFile(
51  const std::string& section) const override; // See base docs
52  };
53 
55 
56  virtual void clear() override;
57 
58  protected:
59  mrpt::math::CRuntimeCompiledExpression m_expr_scalar_formula;
60  std::map<std::string, double> m_expr_scalar_vars;
61 
62  // This virtual method is called by decide().
63  int impl_decide(
64  const std::vector<mrpt::nav::TCandidateMovementPTG>& movs,
65  TResultInfo& extra_info) override;
66 };
67 }
68 }
int impl_decide(const std::vector< mrpt::nav::TCandidateMovementPTG > &movs, TResultInfo &extra_info) override
This class allows loading and storing values and vectors of different types from a configuration text...
const GLubyte * c
Definition: glext.h:6313
#define DEFINE_MRPT_OBJECT(class_name)
This declaration must be inserted in all CObject classes definition, within the class declaration...
Definition: CObject.h:186
virtual void clear() override
Resets the object state; use if the parameters change, so they are re-read and applied.
Implementation of multi-objective motion chooser using scalarization: a user-given formula is used to...
void saveConfigFile(mrpt::utils::CConfigFileBase &c) const override
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
GLsizei const GLchar ** string
Definition: glext.h:4101
void saveToConfigFile(mrpt::utils::CConfigFileBase &cfg, const std::string &section) const override
This method saves the options to a ".ini"-like file or memory-stored string list. ...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Virtual base class for multi-objective motion choosers, as used for reactive navigation engines...
void loadConfigFile(const mrpt::utils::CConfigFileBase &c) override
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
std::string scalar_score_formula
A formula that takes all/a subset of scores and generates a scalar global score.
mrpt::math::CRuntimeCompiledExpression m_expr_scalar_formula



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019