Fawkes API Fawkes Development Version
config_estimator.h
1/***************************************************************************
2 * config_estimator.h - Read estimated execution time from config
3 *
4 * Created: Sun 22 Dec 2019 17:16:23 CET 17:16
5 * Copyright 2019 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
6 ****************************************************************************/
7
8/* This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Library General Public License for more details.
17 *
18 * Read the full text in the LICENSE.GPL file in the doc directory.
19 */
20
21#pragma once
22
23#include <config/config.h>
24#include <execution_time_estimator/execution_time_estimator.h>
25
26#include <map>
27
28namespace fawkes {
30{
31public:
32 ConfigExecutionTimeEstimator(Configuration *config, const std::string &cfg_prefix);
33 bool can_execute(const Skill &skill) override;
34 float get_execution_time(const Skill &skill) override;
35 bool can_provide_exec_time(const Skill &skill) const override;
36
37private:
38 /** Execution times of all whitelisted skills */
39 const Property<float> exec_times_;
40};
41} // namespace fawkes
Get a static estimate for the skill execution time from the config.
ConfigExecutionTimeEstimator(Configuration *config, const std::string &cfg_prefix)
Constructor.
float get_execution_time(const Skill &skill) override
Get the estimated execution time for the given skill string.
bool can_execute(const Skill &skill) override
Check if this estimator is both allowed and able to give an estimate for a given skill.
bool can_provide_exec_time(const Skill &skill) const override
Check if this estimator can give an estimate for a given skill.
Interface for configuration handling.
Definition: config.h:68
A configurable property that is skill-specific and may have a default value.
A structured representation of a skill.
An abstract estimator for the execution time of a skill.
Fawkes library namespace.