37 .CMultiObjectiveMotionOptimizerBase::TParamsBase::loadFromConfigFile(
38 c,
"CMultiObjectiveMotionOptimizerBase");
47 .CMultiObjectiveMotionOptimizerBase::TParamsBase::saveToConfigFile(
48 c,
"CMultiObjectiveMotionOptimizerBase");
54 const std::vector<mrpt::nav::TCandidateMovementPTG>& movs,
58 final_evaluation.clear();
68 for (
const auto& score :
c)
83 catch (std::exception&)
92 final_evaluation.assign(N, .0);
95 for (
size_t i = 0; i < N; i++)
108 "Error: found unexpected (unregistered) score named `%s`.",
109 score.first.c_str());
111 double& var = it->second;
117 if (
val > 0 && (best_idx == -1 ||
val > best_val))
140 scalar_score_formula,
141 "A formula that takes all/a subset of scores and generates a scalar " Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
#define MRPT_LOAD_CONFIG_VAR_REQUIRED_CS(variableName, variableType)
Shortcut for MRPT_LOAD_CONFIG_VAR_NO_DEFAULT() for REQUIRED variables config file object named c and ...
std::vector< double > final_evaluation
The final evaluation score for each candidate.
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
virtual void clear()
Resets the object state; use if the parameters change, so they are re-read and applied.
IMPLEMENTS_MRPT_OBJECT(CMultiObjMotionOpt_Scalarization, CMultiObjectiveMotionOptimizerBase, mrpt::nav) CMultiObjMotionOpt_Scalarization
int impl_decide(const std::vector< mrpt::nav::TCandidateMovementPTG > &movs, TResultInfo &extra_info) override
void clear()
Clear the contents of this container.
std::vector< std::map< std::string, double > > score_values
For each candidate (vector indices), the numerical evaluation of all scores defined in TParamsBase::f...
This class allows loading and storing values and vectors of different types from a configuration text...
#define MRPT_SAVE_CONFIG_VAR_COMMENT(variableName, __comment)
CMultiObjMotionOpt_Scalarization()
std::map< std::string, double > m_expr_scalar_vars
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 §ion) override
This method load the options from a ".ini"-like file or memory-stored string list.
GLsizei const GLchar ** string
void saveToConfigFile(mrpt::utils::CConfigFileBase &cfg, const std::string §ion) const override
This method saves the options to a ".ini"-like file or memory-stored string list. ...
Virtual base class for multi-objective motion choosers, as used for reactive navigation engines...
void loadConfigFile(const mrpt::utils::CConfigFileBase &c) override
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