Fawkes API Fawkes Development Version
|
Get a static estimate for the skill execution time from the config. More...
Public Member Functions | |
ConfigExecutionTimeEstimator (Configuration *config, const std::string &cfg_prefix) | |
Constructor. More... | |
bool | can_execute (const Skill &skill) override |
Check if this estimator is both allowed and able to give an estimate for a given skill. More... | |
float | get_execution_time (const Skill &skill) override |
Get the estimated execution time for the given skill string. More... | |
bool | can_provide_exec_time (const Skill &skill) const override |
Check if this estimator can give an estimate for a given skill. More... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
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... | |
Get a static estimate for the skill execution time from the config.
This simply reads the execution time from the config.
Definition at line 29 of file config_estimator.h.
fawkes::ConfigExecutionTimeEstimator::ConfigExecutionTimeEstimator | ( | Configuration * | config, |
const std::string & | cfg_prefix | ||
) |
Constructor.
config | The config to read from |
cfg_prefix | The config prefix to read from |
Definition at line 38 of file config_estimator.cpp.
|
overridevirtual |
Check if this estimator is both allowed and able to give an estimate for a given skill.
skill | The skill object to check. |
Reimplemented from fawkes::ExecutionTimeEstimator.
Definition at line 45 of file config_estimator.cpp.
References fawkes::ExecutionTimeEstimator::can_execute(), and can_provide_exec_time().
|
overridevirtual |
Check if this estimator can give an estimate for a given skill.
skill | The skill object to check. |
Implements fawkes::ExecutionTimeEstimator.
Definition at line 51 of file config_estimator.cpp.
References fawkes::ExecutionTimeEstimator::active_whitelist_entry_, fawkes::ExecutionTimeEstimator::cfg_prefix_, fawkes::ExecutionTimeEstimator::config_, fawkes::Configuration::exists(), and fawkes::ExecutionTimeEstimator::whitelist_.
Referenced by can_execute().
|
overridevirtual |
Get the estimated execution time for the given skill string.
skill | The skill object to compute the execution time for. |
Implements fawkes::ExecutionTimeEstimator.
Definition at line 62 of file config_estimator.cpp.
References fawkes::ExecutionTimeEstimator::get_property(), and fawkes::ExecutionTimeEstimator::speed_.