dacbench.abstract_benchmark¶
Module Contents¶
Classes¶
Abstract template for benchmark classes |
|
Modified dict to make config changes more flexible |
- class dacbench.abstract_benchmark.AbstractBenchmark(config_path=None, config: dacbench.abstract_benchmark.objdict = None)¶
Abstract template for benchmark classes
- get_config(self)¶
Return current configuration
- Returns
Current config
- Return type
dict
- serialize_config(self)¶
Save configuration to json
- Parameters
path (str) – File to save config to
- process_configspace(self, configuration_space)¶
This is largely the builting cs.json.write method, but doesn’t save the result directly If this is ever implemented in cs, we can replace this method
- static from_json(json_config)¶
- to_json(self)¶
- save_config(self, path)¶
- jsonify_wrappers(self)¶
- dejson_wrappers(self, wrapper_list)¶
- static __import_from(module: str, name: str)¶
Imports the class / function / … with name from module :param module: :param name:
- Returns
- Return type
the imported object
- static __decorate_config_with_functions(conf: dict)¶
Replaced the stringified functions with the callable objects :param config:
- static __stringify_functions(conf: dict) dict¶
Replaced all callables in the config with a triple (‘function’, module_name, function_name)
- Parameters
config –
- Returns
- Return type
modified dict
- space_to_list(self, space)¶
- list_to_space(self, space_list)¶
- jsonify_dict_space(self, dict_space)¶
- dictify_json(self, dict_list)¶
- load_config(self, config: dacbench.abstract_benchmark.objdict)¶
- read_config_file(self, path)¶
Read configuration from file
- Parameters
path (str) – Path to config file
- abstract get_environment(self)¶
Make benchmark environment
- Returns
env – Benchmark environment
- Return type
gym.Env
- set_seed(self, seed)¶
Set environment seed
- Parameters
seed (int) – New seed
- set_action_space(self, kind, args)¶
Change action space
- Parameters
kind (str) – Name of action space class
args (list) – List of arguments to pass to action space class
- set_observation_space(self, kind, args, data_type)¶
Change observation_space
- Parameters
kind (str) – Name of observation space class
args (list) – List of arguments to pass to observation space class
data_type (type) – Data type of observation space
- register_wrapper(self, wrap_func)¶
- class dacbench.abstract_benchmark.objdict¶
Bases:
dictModified dict to make config changes more flexible
- __getattr__(self, name)¶
- __setattr__(self, name, value)¶
Implement setattr(self, name, value).
- __delattr__(self, name)¶
Implement delattr(self, name).
- copy(self)¶
D.copy() -> a shallow copy of D