pycellga.problems.single_objective.discrete.binary package

Submodules

pycellga.problems.single_objective.discrete.binary.count_sat module

class pycellga.problems.single_objective.discrete.binary.count_sat.CountSat[source]

Bases: AbstractProblem

CountSat function implementation for optimization problems.

The CountSat function is used for testing optimization algorithms, particularly those involving satisfiability problems.

None
f(x: list) float[source]

Calculates the CountSat function value for a given list of variables.

Notes

Length of chromosomes = 20 Maximum Fitness Value = 6860 Maximum Fitness Value (normalized) = 1

f(x: list) float[source]

Calculate the CountSat function value for a given list of variables.

Parameters:

x (list) – A list of binary variables.

Returns:

The normalized CountSat function value.

Return type:

float

pycellga.problems.single_objective.discrete.binary.ecc module

class pycellga.problems.single_objective.discrete.binary.ecc.Ecc[source]

Bases: AbstractProblem

Error Correcting Codes Design Problem (ECC) function implementation for optimization problems.

The ECC function is used for testing optimization algorithms, particularly those involving error-correcting codes.

None
f(x: list) float[source]

Calculates the ECC function value for a given list of variables.

Notes

Length of chromosomes = 144 Maximum Fitness Value = 0.0674

f(x: list) float[source]

Calculate the ECC function value for a given list of variables.

Parameters:

x (list) – A list of binary variables.

Returns:

The ECC function value.

Return type:

float

pycellga.problems.single_objective.discrete.binary.fms module

class pycellga.problems.single_objective.discrete.binary.fms.Fms[source]

Bases: AbstractProblem

Frequency Modulation Sound (FMS) function implementation for optimization problems.

The FMS function is used for testing optimization algorithms, particularly those involving frequency modulation sound.

None
f(x: list) float[source]

Calculates the FMS function value for a given list of variables.

Notes

Length of chromosomes = 192 Maximum Fitness Value = 0.01 Maximum Fitness Value Error = 10^-2

f(x: list) float[source]

Calculate the FMS function value for a given list of variables.

Parameters:

x (list) – A list of binary variables.

Returns:

The FMS function value.

Return type:

float

pycellga.problems.single_objective.discrete.binary.maxcut100 module

class pycellga.problems.single_objective.discrete.binary.maxcut100.Maxcut100[source]

Bases: AbstractProblem

A class used to represent the Maximum Cut (MAXCUT) function for 100 nodes.

None
f(x: list) float[source]

Calculates the fitness value of a given chromosome.

Notes

Length of chromosomes = 100 Maximum Fitness Value = 1077.0

f(x: list) float[source]

Calculates the fitness value of a given chromosome for the Maxcut problem.

Parameters:

x (list) – A list representing a chromosome.

Returns:

The fitness value of the chromosome.

Return type:

float

pycellga.problems.single_objective.discrete.binary.maxcut20_01 module

class pycellga.problems.single_objective.discrete.binary.maxcut20_01.Maxcut20_01[source]

Bases: AbstractProblem

Maximum Cut (MAXCUT) function implementation for optimization problems.

The MAXCUT function is used for testing optimization algorithms, particularly those involving maximum cut problems.

None
f(x: list) float[source]

Calculates the MAXCUT function value for a given list of variables.

Notes

Length of chromosomes = 20 Maximum Fitness Value = 10.119812

f(x: list) float[source]

Calculate the MAXCUT function value for a given list of variables.

Parameters:

x (list) – A list of binary variables.

Returns:

The MAXCUT function value.

Return type:

float

pycellga.problems.single_objective.discrete.binary.maxcut20_09 module

class pycellga.problems.single_objective.discrete.binary.maxcut20_09.Maxcut20_09[source]

Bases: AbstractProblem

Maximum Cut (MAXCUT) function implementation for optimization problems.

The MAXCUT function is used for testing optimization algorithms, particularly those involving maximum cut problems.

None
f(x: list) float[source]

Calculates the MAXCUT function value for a given list of variables.

Notes

Length of chromosomes = 20 Maximum Fitness Value = 56.740064

f(x: list) float[source]

Calculate the MAXCUT function value for a given list of variables.

Parameters:

x (list) – A list of binary variables.

Returns:

The MAXCUT function value.

Return type:

float

pycellga.problems.single_objective.discrete.binary.mmdp module

class pycellga.problems.single_objective.discrete.binary.mmdp.Mmdp[source]

Bases: AbstractProblem

Represents the Massively Multimodal Deceptive Problem (MMDP).

The MMDP is designed to deceive genetic algorithms by having multiple local optima. The problem is characterized by a chromosome length of 240 and a maximum fitness value of 40.

None
f(x: list) float[source]

Evaluates the fitness of a given chromosome.

Notes

# Length of chromosomes = 240 # Maximum Fitness Value = 40

f(x: list) float[source]

Evaluates the fitness of a given chromosome for the MMDP.

The fitness function is calculated based on the number of ones in each of the 40 subproblems, each of length 6.

Parameters:

x (list) – A list representing the chromosome, where each element is a binary value (0 or 1).

Returns:

The normalized fitness value of the chromosome, rounded to three decimal places.

Return type:

float

pycellga.problems.single_objective.discrete.binary.one_max module

class pycellga.problems.single_objective.discrete.binary.one_max.OneMax[source]

Bases: AbstractProblem

Represents the OneMax problem.

The OneMax problem is a simple genetic algorithm benchmark problem where the fitness of a chromosome is the sum of its bits.

None
f(x: list) float[source]

Evaluates the fitness of a given chromosome.

f(x) float[source]

Evaluates the fitness of a given chromosome for the OneMax problem.

The fitness function is the sum of all bits in the chromosome.

Parameters:

x (list) – A list representing the chromosome, where each element is a binary value (0 or 1).

Returns:

The fitness value of the chromosome, which is the sum of its bits.

Return type:

float

pycellga.problems.single_objective.discrete.binary.peak module

class pycellga.problems.single_objective.discrete.binary.peak.Peak[source]

Bases: AbstractProblem

Represents the Peak problem.

The Peak problem evaluates the fitness of a chromosome based on its distance to a set of target peaks.

None
f(x: list) float[source]

Evaluates the fitness of a given chromosome.

Notes

# Length of chromosomes = 100 # Maximum Fitness Value = 1.0

f(x: list) float[source]

Evaluates the fitness of a given chromosome for the Peak problem.

The fitness function calculates the distance between the given chromosome and a set of randomly generated target peaks.

Parameters:

x (list) – A list representing the chromosome, where each element is a binary value (0 or 1).

Returns:

The fitness value of the chromosome, normalized to a range of 0.0 to 1.0.

Return type:

float

Module contents