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-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
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::config::CConfigFileBase& c) override;
36  void saveConfigFile(mrpt::config::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:
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 }
mrpt::nav::CMultiObjMotionOpt_Scalarization::TParams::saveToConfigFile
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.
Definition: CMultiObjMotionOpt_Scalarization.cpp:134
mrpt::nav::CMultiObjMotionOpt_Scalarization::m_expr_scalar_vars
std::map< std::string, double > m_expr_scalar_vars
Definition: CMultiObjMotionOpt_Scalarization.h:60
mrpt::nav::CMultiObjMotionOpt_Scalarization::TParams::TParams
TParams()
Definition: CMultiObjMotionOpt_Scalarization.cpp:126
mrpt::nav::CMultiObjectiveMotionOptimizerBase::TParamsBase
Common params for all children.
Definition: CMultiObjectiveMotionOptimizerBase.h:61
c
const GLubyte * c
Definition: glext.h:6313
mrpt::nav::CMultiObjMotionOpt_Scalarization::CMultiObjMotionOpt_Scalarization
CMultiObjMotionOpt_Scalarization()
mrpt::nav::CMultiObjMotionOpt_Scalarization::parameters
TParams parameters
Definition: CMultiObjMotionOpt_Scalarization.h:54
mrpt::nav::CMultiObjectiveMotionOptimizerBase::TResultInfo
Definition: CMultiObjectiveMotionOptimizerBase.h:34
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::nav::CMultiObjMotionOpt_Scalarization::TParams
Definition: CMultiObjMotionOpt_Scalarization.h:38
mrpt::nav::CMultiObjMotionOpt_Scalarization::TParams::loadFromConfigFile
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.
Definition: CMultiObjMotionOpt_Scalarization.cpp:127
source
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
mrpt::nav::CMultiObjMotionOpt_Scalarization::clear
virtual void clear() override
Resets the object state; use if the parameters change, so they are re-read and applied.
Definition: CMultiObjMotionOpt_Scalarization.cpp:25
mrpt::nav::CMultiObjMotionOpt_Scalarization::impl_decide
int impl_decide(const std::vector< mrpt::nav::TCandidateMovementPTG > &movs, TResultInfo &extra_info) override
Definition: CMultiObjMotionOpt_Scalarization.cpp:52
mrpt::nav::CMultiObjMotionOpt_Scalarization::m_expr_scalar_formula
mrpt::expr::CRuntimeCompiledExpression m_expr_scalar_formula
Definition: CMultiObjMotionOpt_Scalarization.h:59
mrpt::nav::CMultiObjMotionOpt_Scalarization::saveConfigFile
void saveConfigFile(mrpt::config::CConfigFileBase &c) const override
Definition: CMultiObjMotionOpt_Scalarization.cpp:42
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::nav::CMultiObjMotionOpt_Scalarization
Implementation of multi-objective motion chooser using scalarization: a user-given formula is used to...
Definition: CMultiObjMotionOpt_Scalarization.h:27
mrpt::nav::CMultiObjectiveMotionOptimizerBase
Virtual base class for multi-objective motion choosers, as used for reactive navigation engines.
Definition: CMultiObjectiveMotionOptimizerBase.h:26
mrpt::expr::CRuntimeCompiledExpression
A wrapper of exprtk runtime expression compiler: it takes a string representing an expression (from a...
Definition: CRuntimeCompiledExpression.h:52
mrpt::nav::CMultiObjMotionOpt_Scalarization::loadConfigFile
void loadConfigFile(const mrpt::config::CConfigFileBase &c) override
Definition: CMultiObjMotionOpt_Scalarization.cpp:32
mrpt::nav::CMultiObjMotionOpt_Scalarization::TParams::scalar_score_formula
std::string scalar_score_formula
A formula that takes all/a subset of scores and generates a scalar global score.
Definition: CMultiObjMotionOpt_Scalarization.h:43
string
GLsizei const GLchar ** string
Definition: glext.h:4101
CMultiObjectiveMotionOptimizerBase.h
DEFINE_MRPT_OBJECT
#define DEFINE_MRPT_OBJECT(class_name)
This declaration must be inserted in all CObject classes definition, within the class declaration.
Definition: CObject.h:176



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST