23 #include <config/config.h>
24 #include <interfaces/SkillerInterface.h>
28 #include <unordered_map>
41 Skill(
const std::string &skill_string);
47 std::unordered_map<std::string, std::string>
skill_args = {};
50 void parse_args(
const std::string &args);
59 const std::string & path,
60 const std::string & property,
61 const std::optional<T> &default_value = std::nullopt);
70 std::optional<T> default_value;
78 virtual std::pair<SkillerInterface::SkillStatusEnum, std::string>
81 return std::make_pair(SkillerInterface::SkillStatusEnum::S_FINAL,
"");
Interface for configuration handling.
A configurable property that is skill-specific and may have a default value.
Property(fawkes::Configuration *config, const std::string &path, const std::string &property, const std::optional< T > &default_value=std::nullopt)
Constructor.
T get_property(const std::string &key) const
Get the property falue for a given skill.
T get_default_value() const
Get the default value if it is set, otherwise throw an exception.
std::map< std::string, T > property_entries
Mapping from skill entry id to property value.
A structured representation of a skill.
bool matches(const Skill &skill) const
Check, whether the skill matches another skill description.
std::string skill_name
The name of the skill.
Skill(const std::string &skill_string)
Constructor.
std::unordered_map< std::string, std::string > skill_args
A map of the skill's argument keys to argument values.
An abstract estimator for the execution time of a skill.
virtual float get_execution_time(const Skill &skill)=0
Get the estimated execution time for the given skill string.
virtual bool can_provide_exec_time(const Skill &skill) const =0
Check if this estimator can give an estimate for a given skill.
Configuration *const config_
Config to obtain common configurables.
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.
std::map< std::string, Skill >::const_iterator active_whitelist_entry_
Points to the whitelist entry that matches the skill to execute.
const std::map< std::string, Skill > blacklist_
Blacklist of skills that the estimator must not process.
virtual bool can_execute(const Skill &skill)
Check if this estimator is both allowed and able to give an estimate for a given skill.
const std::map< std::string, Skill > whitelist_
Whitelist of skills that the estimator is allowed to process.
T get_property(const Property< T > &property) const
Get the current property value for active_whitelist_entry_.
virtual ~ExecutionTimeEstimator()=default
Destructor.
std::map< std::string, Skill > get_skills_from_config(const std::string &path) const
Load skill descriptions from a yaml config.
const std::string cfg_prefix_
Config prefix of the estimator.
ExecutionTimeEstimator(Configuration *config, const ::std::string &cfg_prefix)
Constructor.
const float speed_
Config estimator-specific speedup factor.
Fawkes library namespace.