brkga_mp_ipr.enums module¶
-
class
brkga_mp_ipr.enums.BiasFunctionType[source]¶ Bases:
brkga_mp_ipr.enums.ParsingEnumSpecifies a bias function when choosing parents to mating. This function substitutes the \(\rho\) (rho) parameter from the original BRKGA. For a given rank \(r\), we have the following functions:
CONSTANT: 1 / number of parents for mating (all individuals have the same probability)CUBIC: \(r^{-3}\)EXPONENTIAL: \(\epsilon^{-r}\)LINEAR: \(1 / r\)LOGINVERSE: \(1 / \log(r + 1)\)QUADRATIC: \(r^{-2}\)
-
CONSTANT= 0¶
-
CUBIC= 1¶
-
CUSTOM= 6¶
-
EXPONENTIAL= 2¶
-
LINEAR= 3¶
-
LOGINVERSE= 4¶
-
QUADRATIC= 5¶
-
class
brkga_mp_ipr.enums.ParsingEnum[source]¶ Bases:
enum.EnumImplements a base Enum class that returns an Enum object from a string (case insensitive).
-
class
brkga_mp_ipr.enums.PathRelinkingResult[source]¶ Bases:
enum.FlagSpecifies the result type/status of path relink procedure:
TOO_HOMOGENEOUS: the chromosomes among the populations are too homogeneous and the path relink will not generate improveded solutions.NO_IMPROVEMENT: path relink was done but no improveded solution was found.ELITE_IMPROVEMENT: an improved solution among the elite set was found, but the best solution was not improved.BEST_IMPROVEMENT: the best solution was improved.
-
BEST_IMPROVEMENT= 7¶
-
ELITE_IMPROVEMENT= 3¶
-
NO_IMPROVEMENT= 1¶
-
TOO_HOMOGENEOUS= 0¶
-
class
brkga_mp_ipr.enums.PathRelinkingSelection[source]¶ Bases:
brkga_mp_ipr.enums.ParsingEnumSpecifies which individuals used to build the path:
BESTSOLUTION: selects, in the order, the best solution of each population.RANDOMELITE: chooses uniformly random solutions from the elite sets.
-
BESTSOLUTION= 0¶
-
RANDOMELITE= 1¶
-
class
brkga_mp_ipr.enums.PathRelinkingType[source]¶ Bases:
brkga_mp_ipr.enums.ParsingEnumSpecifies type of path relinking:
DIRECT: changes each key for the correspondent in the other chromosome.PERMUTATION: switches the order of a key for that in the other chromosome.
-
DIRECT= 0¶
-
PERMUTATION= 1¶
-
class
brkga_mp_ipr.enums.Sense[source]¶ Bases:
brkga_mp_ipr.enums.ParsingEnumTells the algorithm either to
MINIMIZEorMAXIMIZEthe objective function.-
MAXIMIZE= 1¶
-
MINIMIZE= 0¶
-
-
class
brkga_mp_ipr.enums.ShakingType[source]¶ Bases:
brkga_mp_ipr.enums.ParsingEnumSpecifies the type of shaking to be performed.
CHANGE: applies the following perturbations:Inverts the value of a random chosen, i.e., from \(value\) to \(1 - value\);
Assigns a random value to a random key.
SWAP: applies two swap perturbations:Swaps the values of a randomly chosen key \(i\) and its neighbor \(i + 1\);
Swaps values of two randomly chosen keys.
-
CHANGE= 0¶
-
SWAP= 1¶