selector.read_files

This module contains functions for reading in files for the scenario.

Functions

get_categorical(param_name, param_info)

For a categorical parameter: check if its parsed attributes are valid and extract information on the parameter

get_conditional(param_name, param_info, ...)

For a parameter: get the information on conditionals

get_continuous(param_name, param_info)

For a continuous parameter: check if its parsed attributes are valid and extract information on the parameter

get_no_goods(no_good, parameters)

Takes a string of the form: {param_1=value_1 , param_2=value_2, ...} and returns a dictionary of the no good

get_ta_arguments_from_pcs(para_file)

Read a file that contains the target algorithm parameters.

read_instance_features(feature_set_path)

Read in features from an AClib features file

read_instance_paths(instance_set_path)

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

selector.read_files.read_instance_paths(instance_set_path)[source]

Read in instances from an AClib instance file

Parameters:

instance_set_path (str) – Path to the instance file.

Returns:

List of paths to the instances.

Return type:

list