selector.generators.variable_graph_point_generator

This module contains the variable graph point generator.

Based on the variable tree in GGA [Ansótegui, C., Sellmann, M., Tierney, K.: A Gender-Based Genetic Algorithm for the Automatic Configuration of Algorithms. In: Principles and Practice of Constraint Programming - CP 2009. pp. 142–157 (09 2009).]

Functions

check_valid(config_label, C, N, cn)

Check if parameter is actually set in Configuration.

choose_parents(mode, data, lookback, results)

Pick configurations according to mode.

decide_for_O(config_label, C, N, cn)

Decide new label in case of label O.

graph_crossover(graph_structure, C, N, s)

Crossover according to variable graph.

reset_no_goods(s, config_setting, label, C, N)

Check if no goods are violated and change value if so.

set_config_label(paths, config_label, cn, C, N)

Set label.

variable_graph_point(s, identity, results[, ...])

Configuration is generated via variable graph method.

variable_graph_structure(s)

General variable graph structure is read from scenario.

Classes

LabelType(value)

Contains the types of labels a node can assume.

Mode(value)

Contains the types of modes for choosing parent configurations.

class selector.generators.variable_graph_point_generator.LabelType(value)[source]

Bases: IntEnum

Contains the types of labels a node can assume.

C = 1
N = 2
O = 3
class selector.generators.variable_graph_point_generator.Mode(value)[source]

Bases: Enum

Contains the types of modes for choosing parent configurations.

best_and_random = 3
only_best = 2
random = 1
selector.generators.variable_graph_point_generator.check_valid(config_label, C, N, cn)[source]

Check if parameter is actually set in Configuration.

Parameters:
  • config_label (dict) – Current labeling of parameters.

  • C (dict) – First configuration.

  • N (dict) – Second configuration.

Returns:

Updated configuration label.

Return type:

dict

selector.generators.variable_graph_point_generator.choose_parents(mode, data, lookback, results)[source]

Pick configurations according to mode.

Parameters:
Returns:

  • C : dict, Configuration C.

  • N : dict, Configuration N.

Return type:

tuple

selector.generators.variable_graph_point_generator.decide_for_O(config_label, C, N, cn)[source]

Decide new label in case of label O.

Parameters:
  • config_label (dict) – Current labeling of parameters.

  • C (dict) – First configuration.

  • N (dict) – Second configuration.

  • cn (str) – Child node in the graph.

Returns:

Updated configuration label.

Return type:

dict

selector.generators.variable_graph_point_generator.graph_crossover(graph_structure, C, N, s)[source]

Crossover according to variable graph.

Parameters:
  • graph_structure (dict of list) – General variable graph structure.

  • C (dict) – Configuration 1.

  • N (dict) – Configuration 2.

  • s (selector.scenario.Scenario) – AC scenario.

Returns:

New configuration setting.

Return type:

dict

selector.generators.variable_graph_point_generator.reset_no_goods(s, config_setting, label, C, N)[source]

Check if no goods are violated and change value if so.

Parameters:
  • s (selector.scenario.Scenario) – AC scenario.

  • config_setting (dict) – Parameter value setting.

  • label (str) – Label.

  • C (dict) – First configuration.

  • N (dict) – Second configuration.

Returns:

Updated config_setting.

Return type:

dict

selector.generators.variable_graph_point_generator.set_config_label(paths, config_label, cn, C, N)[source]

Set label.

Parameters:
Returns:

Updated config_label.

Return type:

dict

selector.generators.variable_graph_point_generator.variable_graph_point(s, identity, results, mode=Mode.best_and_random, alldata=False, lookback=1, seed=False)[source]

Configuration is generated via variable graph method.

Parameters:
Returns:

Configuration generated with GGA graph.

Return type:

selector.pool.Configuration

selector.generators.variable_graph_point_generator.variable_graph_structure(s)[source]

General variable graph structure is read from scenario.

Parameters:

s (selector.scenario.Scenario) – AC scenario.

Returns:

General variable graph structure.

Return type:

dict of lists