# macop.policies.base — macop v1.0.5 documentation

# macop.policies.base

Abstract classes for Operator Selection Strategy

Classes

`Policy`(operators) | Abstract class which is used for applying strategy when selecting and applying operator

class `macop.policies.base.``Policy`(operators)

  Abstract class which is used for applying strategy when selecting and applying operator

  `operators`

    {[Operator]} – list of selected operators for the algorithm

  `apply`(solution)

    Apply specific operator chosen to create new solution, computes its fitness and returns solution

    Parameters

      _solution – {Solution} – the solution to use for generating new solution

    Returns

      {Solution} – new generated solution

  abstract `select`()

    Select specific operator

    Returns

      {Operator} – selected operator

  `setAlgo`(algo)
    Keep into policy reference of the whole algorithm

      The reason is to better manage the operator choices (use of rewards as example)

    Parameters

      algo – {Algorithm} – the algorithm reference runned