# macop.operators.policies.Policy

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

Classes

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

class `macop.operators.policies.Policy.``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