|
Fawkes API
Fawkes Development Version
|
An abstract estimator for the execution time of a skill. More...

Classes | |
| class | Property |
| A configurable property that is skill-specific and may have a default value. More... | |
| class | Skill |
| A structured representation of a skill. More... | |
Public Member Functions | |
| ExecutionTimeEstimator (Configuration *config, const ::std::string &cfg_prefix) | |
| Constructor. More... | |
| virtual | ~ExecutionTimeEstimator ()=default |
| Destructor. More... | |
| virtual float | get_execution_time (const Skill &skill)=0 |
| Get the estimated execution time for the given skill string. More... | |
| virtual bool | can_execute (const Skill &skill) |
| Check if this estimator is both allowed and able to give an estimate for a given skill. More... | |
| virtual std::pair< SkillerInterface::SkillStatusEnum, std::string > | execute (const Skill &skill) |
| Let the estimator know that we are executing this skill, so it can apply possible side effects. More... | |
Protected Member Functions | |
| std::map< std::string, Skill > | get_skills_from_config (const std::string &path) const |
| Load skill descriptions from a yaml config. More... | |
| virtual bool | can_provide_exec_time (const Skill &skill) const =0 |
| Check if this estimator can give an estimate for a given skill. More... | |
| template<typename T > | |
| T | get_property (const Property< T > &property) const |
| Get the current property value for active_whitelist_entry_. More... | |
Protected Attributes | |
| Configuration *const | config_ |
| Config to obtain common configurables. More... | |
| const std::string | cfg_prefix_ |
| Config prefix of the estimator. More... | |
| const float | speed_ |
| Config estimator-specific speedup factor. More... | |
| std::map< std::string, Skill >::const_iterator | active_whitelist_entry_ |
| Points to the whitelist entry that matches the skill to execute. More... | |
| const std::map< std::string, Skill > | whitelist_ |
| Whitelist of skills that the estimator is allowed to process. More... | |
| const std::map< std::string, Skill > | blacklist_ |
| Blacklist of skills that the estimator must not process. More... | |
An abstract estimator for the execution time of a skill.
Inherit from this class if you want to implement an estimator for a skill or a set of skills.
Definition at line 33 of file execution_time_estimator.h.
| fawkes::ExecutionTimeEstimator::ExecutionTimeEstimator | ( | Configuration * | config, |
| const ::std::string & | cfg_prefix | ||
| ) |
Constructor.
Load config values that are common for all executors.
| config | configuration to read all values from |
| cfg_prefix | prefix where the estimator-specific configs are located |
Definition at line 109 of file execution_time_estimator.cpp.
References speed_.
|
virtualdefault |
Destructor.
|
virtual |
Check if this estimator is both allowed and able to give an estimate for a given skill.
| skill | The skill object to check. |
Reimplemented in fawkes::ConfigExecutionTimeEstimator.
Definition at line 121 of file execution_time_estimator.cpp.
References active_whitelist_entry_, blacklist_, can_provide_exec_time(), and whitelist_.
Referenced by fawkes::ConfigExecutionTimeEstimator::can_execute().
|
protectedpure virtual |
Check if this estimator can give an estimate for a given skill.
| skill | The skill object to check. |
Implemented in fawkes::ConfigExecutionTimeEstimator, fawkes::NavGraphEstimator, and fawkes::LookupEstimator.
Referenced by can_execute().
|
inlinevirtual |
Let the estimator know that we are executing this skill, so it can apply possible side effects.
| skill | The skill to execute |
Reimplemented in fawkes::NavGraphEstimator, and fawkes::LookupEstimator.
Definition at line 79 of file execution_time_estimator.h.
|
pure virtual |
Get the estimated execution time for the given skill string.
| skill | The skill object to compute the execution time for. |
Implemented in fawkes::ConfigExecutionTimeEstimator, fawkes::NavGraphEstimator, and fawkes::LookupEstimator.
|
protected |
Get the current property value for active_whitelist_entry_.
| property | property where the current value should be retrieved from |
Definition at line 233 of file execution_time_estimator.cpp.
References active_whitelist_entry_, and whitelist_.
Referenced by fawkes::NavGraphEstimator::can_provide_exec_time(), fawkes::LookupEstimator::get_execution_time(), fawkes::NavGraphEstimator::get_execution_time(), and fawkes::ConfigExecutionTimeEstimator::get_execution_time().
|
protected |
Load skill descriptions from a yaml config.
The skills are represented via suffixes /<description-id>/name and /<description-id>/args following the
| path | config path under which the skill descriptions are located |
Definition at line 205 of file execution_time_estimator.cpp.
References config_, fawkes::Configuration::search(), fawkes::str_join(), and fawkes::str_split().
|
protected |
Points to the whitelist entry that matches the skill to execute.
Definition at line 98 of file execution_time_estimator.h.
Referenced by can_execute(), fawkes::ConfigExecutionTimeEstimator::can_provide_exec_time(), and get_property().
|
protected |
Blacklist of skills that the estimator must not process.
Definition at line 102 of file execution_time_estimator.h.
Referenced by can_execute().
|
protected |
Config prefix of the estimator.
Definition at line 94 of file execution_time_estimator.h.
Referenced by fawkes::ConfigExecutionTimeEstimator::can_provide_exec_time().
|
protected |
Config to obtain common configurables.
Definition at line 92 of file execution_time_estimator.h.
Referenced by fawkes::ConfigExecutionTimeEstimator::can_provide_exec_time(), and get_skills_from_config().
|
protected |
Config estimator-specific speedup factor.
Definition at line 96 of file execution_time_estimator.h.
Referenced by ExecutionTimeEstimator(), fawkes::LookupEstimator::get_execution_time(), fawkes::NavGraphEstimator::get_execution_time(), and fawkes::ConfigExecutionTimeEstimator::get_execution_time().
|
protected |
Whitelist of skills that the estimator is allowed to process.
Definition at line 100 of file execution_time_estimator.h.
Referenced by can_execute(), fawkes::ConfigExecutionTimeEstimator::can_provide_exec_time(), and get_property().