MRPT  1.9.9
CMultiObjMotionOpt_Scalarization.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://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. */
41  std::string scalar_score_formula;
42 
43  TParams();
44  void loadFromConfigFile(
45  const mrpt::config::CConfigFileBase& source,
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  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 } // namespace mrpt::nav
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...
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...
mrpt::expr::CRuntimeCompiledExpression m_expr_scalar_formula
Virtual base class for multi-objective motion choosers, as used for reactive navigation engines...
std::string scalar_score_formula
A formula that takes all/a subset of scores and generates a scalar global score.
#define DEFINE_MRPT_OBJECT(class_name, NameSpace)
This declaration must be inserted in all CObject classes definition, within the class declaration...
Definition: CObject.h:211
void saveConfigFile(mrpt::config::CConfigFileBase &c) const override



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7e629e01a Sat Dec 14 00:05:55 2019 +0100 at sáb dic 14 00:15:10 CET 2019