#include <PolicyStore.hpp>
|
| PolicyStore ()=default |
|
virtual | ~PolicyStore ()=default |
|
virtual std::vector< double > | get_best (const std::string &agent_name, const std::string &profile_name) const =0 |
| Get the best known policy for a given agent/profile pair.
|
|
virtual void | set_best (const std::string &agent_name, const std::string &profile_name, const std::vector< double > &policy)=0 |
| Set the record for the best policy for a profile with an agent.
|
|
virtual void | set_default (const std::string &agent_name, const std::vector< double > &policy)=0 |
| Set the default policy to use with an agent.
|
|
|
static std::unique_ptr< PolicyStore > | make_unique (const std::string &data_path) |
| Returns a unique_ptr to a concrete object constructed using the underlying implementation.
|
|
static std::shared_ptr< PolicyStore > | make_shared (const std::string &data_path) |
| Returns a shared_ptr to a concrete object constructed using the underlying implementation.
|
|
Manages a data store of best known policies for profiles used with agents. The data store includes records of best known policies and default policies to apply when a best run has not yet been recorded.
◆ PolicyStore()
geopm::PolicyStore::PolicyStore |
( |
| ) |
|
|
default |
◆ ~PolicyStore()
virtual geopm::PolicyStore::~PolicyStore |
( |
| ) |
|
|
virtualdefault |
◆ get_best()
virtual std::vector< double > geopm::PolicyStore::get_best |
( |
const std::string & |
agent_name, |
|
|
const std::string & |
profile_name |
|
) |
| const |
|
pure virtual |
Get the best known policy for a given agent/profile pair.
Returns the best known policy from the data store. If no best policy is known, the default policy for the agent is returned. An exception is thrown if no default exists, or if any data store errors occur.
- Parameters
-
[in] | agent_name | Name of the agent to look up |
[in] | profile_name | Name of the profile to look up |
- Returns
- The recommended policy for the profile to use with the agent.
Implemented in geopm::PolicyStoreImp.
◆ make_shared()
std::shared_ptr< PolicyStore > geopm::PolicyStore::make_shared |
( |
const std::string & |
data_path | ) |
|
|
static |
Returns a shared_ptr to a concrete object constructed using the underlying implementation.
◆ make_unique()
std::unique_ptr< PolicyStore > geopm::PolicyStore::make_unique |
( |
const std::string & |
data_path | ) |
|
|
static |
Returns a unique_ptr to a concrete object constructed using the underlying implementation.
◆ set_best()
virtual void geopm::PolicyStore::set_best |
( |
const std::string & |
agent_name, |
|
|
const std::string & |
profile_name, |
|
|
const std::vector< double > & |
policy |
|
) |
| |
|
pure virtual |
Set the record for the best policy for a profile with an agent.
Creates or overwrites the best-known policy for a profile when used with the given agent.
- Parameters
-
[in] | agent_name | Name of the agent for which this policy applies. |
[in] | profile_name | Name of the profile whose policy is being set. |
[in] | policy | Policy string to use with the given agent. |
Implemented in geopm::PolicyStoreImp.
◆ set_default()
virtual void geopm::PolicyStore::set_default |
( |
const std::string & |
agent_name, |
|
|
const std::vector< double > & |
policy |
|
) |
| |
|
pure virtual |
Set the default policy to use with an agent.
- Parameters
-
[in] | agent_name | Name of the agent for which this policy applies. |
[in] | policy | Policy string to use with the given agent. |
Implemented in geopm::PolicyStoreImp.
The documentation for this class was generated from the following files: