macop.operators.base
Abstract Operator classes
Classes
Crossover ()
|
Abstract crossover extend from Operator |
KindOperator
|
Enum in order to recognize kind of operators |
Mutation ()
|
Abstract Mutation extend from Operator |
Operator ()
|
Abstract Operator class which enables to update solution applying operator (computation) |
-
class
macop.operators.base.
Crossover
[source]
Bases: macop.operators.base.Operator
Abstract crossover extend from Operator
-
kind
{KindOperator
} – specify the kind of operator
-
apply
(solution1, solution2=None)[source]
Apply crossover using two solutions in order to obtained new solution
- Parameters
-
- Returns
{Solution
} – new generated solution
-
setAlgo
(algo)
- Keep into operator reference of the whole algorithm
The reason is to better manage operator instance
- Parameters
algo – {Algorithm
} – the algorithm reference runned
-
class
macop.operators.base.
KindOperator
[source]
Bases: enum.Enum
Enum in order to recognize kind of operators
-
class
macop.operators.base.
Mutation
[source]
Bases: macop.operators.base.Operator
Abstract Mutation extend from Operator
-
kind
{KindOperator
} – specify the kind of operator
-
apply
(solution)[source]
Apply mutation over solution in order to obtained new solution
- Parameters
solution – {Solution
} – solution to use in order to create new solution
- Returns
{Solution
} – new generated solution
-
setAlgo
(algo)
- Keep into operator reference of the whole algorithm
The reason is to better manage operator instance
- Parameters
algo – {Algorithm
} – the algorithm reference runned
-
class
macop.operators.base.
Operator
[source]
Bases: object
Abstract Operator class which enables to update solution applying operator (computation)
-
abstract
apply
(solution)[source]
Apply the current operator transformation
- Parameters
solution – {Solution
} – Solution instance
-
setAlgo
(algo)[source]
- Keep into operator reference of the whole algorithm
The reason is to better manage operator instance
- Parameters
algo – {Algorithm
} – the algorithm reference runned