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-2018, 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::nav
14 {
15 /** Implementation of multi-objective motion chooser using scalarization: a
16  * user-given formula is used to
17  * collapse all the scores into a single scalar score. The candidate with the
18  * highest positive score is selected.
19  * Note that assert expressions are honored via the base class
20  * CMultiObjectiveMotionOptimizerBase
21  *
22  * \sa CReactiveNavigationSystem, CReactiveNavigationSystem3D
23  * \ingroup nav_reactive
24  */
27 {
29 
30  public:
32 
33  void loadConfigFile(const mrpt::config::CConfigFileBase& c) override;
34  void saveConfigFile(mrpt::config::CConfigFileBase& c) const override;
35 
36  struct TParams
38  {
39  /** A formula that takes all/a subset of scores and generates a scalar
40  * global score. */
42 
43  TParams();
44  void loadFromConfigFile(
46  const std::string& section) override; // See base docs
47  void saveToConfigFile(
49  const std::string& section) const override; // See base docs
50  };
51 
53 
54  virtual void clear() override;
55 
56  protected:
58  std::map<std::string, double> m_expr_scalar_vars;
59 
60  // This virtual method is called by decide().
61  int impl_decide(
62  const std::vector<mrpt::nav::TCandidateMovementPTG>& movs,
63  TResultInfo& extra_info) override;
64 };
65 }
66 
void loadConfigFile(const mrpt::config::CConfigFileBase &c) override
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section) override
This method load the options from a ".ini"-like file or memory-stored string list.
A wrapper of exprtk runtime expression compiler: it takes a string representing an expression (from a...
void saveToConfigFile(mrpt::config::CConfigFileBase &cfg, const std::string &section) const override
This method saves the options to a ".ini"-like file or memory-stored string list. ...
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:175
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...
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::expr::CRuntimeCompiledExpression m_expr_scalar_formula
Virtual base class for multi-objective motion choosers, as used for reactive navigation engines...
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.
void saveConfigFile(mrpt::config::CConfigFileBase &c) const override



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020