selector.read_files
This module contains functions for reading in files for the scenario.
Functions
|
For a categorical parameter: check if its parsed attributes are valid and extract information on the parameter |
|
For a parameter: get the information on conditionals |
|
For a continuous parameter: check if its parsed attributes are valid and extract information on the parameter |
|
Takes a string of the form: {param_1=value_1 , param_2=value_2, ...} and returns a dictionary of the no good |
|
Read a file that contains the target algorithm parameters. |
|
Read in features from an AClib features file |
|
Read in instances from an AClib instance file |
- selector.read_files.get_categorical(param_name, param_info)[source]
For a categorical parameter: check if its parsed attributes are valid and extract information on the parameter
- Parameters:
param_name (str) – Name of the parameter.
param_info (dict) – Raw parameter information.
- Returns:
param_type : str, Type of the parameter.
bounds : tuple, Formatted bounds of the parameter.
defaults : tuple, Default values of the parameter.
bounds : tuple, Original bounds of the parameter.
- Return type:
tuple
- selector.read_files.get_conditional(param_name, param_info, parameters)[source]
For a parameter: get the information on conditionals
- Parameters:
param_name (str) – Name of the parameter.
param_info (dict) – Raw parameter information.
- Returns:
condition_param : str, Conditional parameter.
condition : str, The condition.
- Return type:
tuple
- selector.read_files.get_continuous(param_name, param_info)[source]
For a continuous parameter: check if its parsed attributes are valid and extract information on the parameter
- Parameters:
param_name (str) – Name of the parameter.
param_info (dict) – Raw parameter information.
- Returns:
param_type : str, Type of the parameter.
bounds : tuple, Formatted bounds of the parameter.
defaults : tuple, Default values of the parameter.
bounds : tuple, Original bounds of the parameter.
- Return type:
tuple
- selector.read_files.get_no_goods(no_good, parameters)[source]
Takes a string of the form: {param_1=value_1 , param_2=value_2, …} and returns a dictionary of the no good
- Parameters:
no_good (str) – Takes a string of the form: {param_1=value_1 , param_2=value_2, …}
parameters (dict) – Raw parameter information.
- Returns:
A dictionary of the no good.
- Return type:
dict
- selector.read_files.get_ta_arguments_from_pcs(para_file)[source]
Read a file that contains the target algorithm parameters.
The file follows the .pcs format and adheres to the AClib structure.
- Parameters:
para_file (str) – Path to the .pcs file.
- Returns:
parameters: list, information on the parameters of the target algorithm.
no_goods: list, information about forbidden parameter value combinations.
conditionals: list, information about conditional parameter value combinations.
- Return type:
tuple
- selector.read_files.read_instance_features(feature_set_path)[source]
Read in features from an AClib features file
- Parameters:
feature_set_path (str) – Path to the feature file.
- Returns:
features : dict, Dictionary with the read-in features.
feature_names : list, List with the feature names.
- Return type:
tuple