Fawkes API Fawkes Development Version
fawkes::ConfigExecutionTimeEstimator Class Reference

Get a static estimate for the skill execution time from the config. More...

Inheritance diagram for fawkes::ConfigExecutionTimeEstimator:

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...
 
- Public Member Functions inherited from fawkes::ExecutionTimeEstimator
 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

- Protected Member Functions inherited from fawkes::ExecutionTimeEstimator
std::map< std::string, Skillget_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 >
get_property (const Property< T > &property) const
 Get the current property value for active_whitelist_entry_. More...
 
- Protected Attributes inherited from fawkes::ExecutionTimeEstimator
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, Skillwhitelist_
 Whitelist of skills that the estimator is allowed to process. More...
 
const std::map< std::string, Skillblacklist_
 Blacklist of skills that the estimator must not process. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConfigExecutionTimeEstimator()

fawkes::ConfigExecutionTimeEstimator::ConfigExecutionTimeEstimator ( Configuration config,
const std::string &  cfg_prefix 
)

Constructor.

Parameters
configThe config to read from
cfg_prefixThe config prefix to read from

Definition at line 38 of file config_estimator.cpp.

Member Function Documentation

◆ can_execute()

bool fawkes::ConfigExecutionTimeEstimator::can_execute ( const Skill skill)
overridevirtual

Check if this estimator is both allowed and able to give an estimate for a given skill.

Parameters
skillThe skill object to check.
Returns
true if this estimator can give an execution time estimate for the given skill.

Reimplemented from fawkes::ExecutionTimeEstimator.

Definition at line 45 of file config_estimator.cpp.

References fawkes::ExecutionTimeEstimator::can_execute(), and can_provide_exec_time().

◆ can_provide_exec_time()

bool fawkes::ConfigExecutionTimeEstimator::can_provide_exec_time ( const Skill skill) const
overridevirtual

Check if this estimator can give an estimate for a given skill.

Parameters
skillThe skill object to check.
Returns
true if this estimator can give an execution time estimate for the given skill.

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().

◆ get_execution_time()

float fawkes::ConfigExecutionTimeEstimator::get_execution_time ( const Skill skill)
overridevirtual

Get the estimated execution time for the given skill string.

Parameters
skillThe skill object to compute the execution time for.
Returns
The execution time in seconds.

Implements fawkes::ExecutionTimeEstimator.

Definition at line 62 of file config_estimator.cpp.

References fawkes::ExecutionTimeEstimator::get_property(), and fawkes::ExecutionTimeEstimator::speed_.


The documentation for this class was generated from the following files: