Skip to content

Commit

Permalink
deploy: 3060c12
Browse files Browse the repository at this point in the history
  • Loading branch information
SevgiAkten committed Dec 16, 2024
1 parent 3f5e3b7 commit f5f5c63
Show file tree
Hide file tree
Showing 136 changed files with 9,036 additions and 17,474 deletions.
2 changes: 1 addition & 1 deletion .buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: a51842efebef2c898364e617c974194f
config: eccf12cbfb532c8f88c604652ac49677
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added _images/alpha_cga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/bit_flip_mutation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/cga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/compact_9_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/cycle_cga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/f_byte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/icga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/ieee.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/linear_5_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/one_point_c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/roulette_wheel_selection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/swap_mutation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/two_point_c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/uniform_c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
187 changes: 56 additions & 131 deletions _modules/index.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/byte_operators.html

Large diffs are not rendered by default.

460 changes: 0 additions & 460 deletions _modules/pycellga/example/example_alpha_cga.html

This file was deleted.

450 changes: 0 additions & 450 deletions _modules/pycellga/example/example_ccga.html

This file was deleted.

458 changes: 0 additions & 458 deletions _modules/pycellga/example/example_cga.html

This file was deleted.

452 changes: 0 additions & 452 deletions _modules/pycellga/example/example_mcccga.html

This file was deleted.

459 changes: 0 additions & 459 deletions _modules/pycellga/example/example_sync_cga.html

This file was deleted.

182 changes: 56 additions & 126 deletions _modules/pycellga/grid.html

Large diffs are not rendered by default.

203 changes: 62 additions & 141 deletions _modules/pycellga/individual.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/bit_flip_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/byte_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/byte_mutation_random.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/float_uniform_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/insertion_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/shuffle_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/swap_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/mutation/two_opt_mutation.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/neighborhoods/compact_13.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/neighborhoods/compact_21.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/neighborhoods/compact_25.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/neighborhoods/compact_9.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/neighborhoods/linear_5.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/neighborhoods/linear_9.html

Large diffs are not rendered by default.

286 changes: 123 additions & 163 deletions _modules/pycellga/optimizer.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/population.html

Large diffs are not rendered by default.

267 changes: 105 additions & 162 deletions _modules/pycellga/problems/abstract_problem.html

Large diffs are not rendered by default.

281 changes: 109 additions & 172 deletions _modules/pycellga/problems/single_objective/continuous/ackley.html

Large diffs are not rendered by default.

263 changes: 95 additions & 168 deletions _modules/pycellga/problems/single_objective/continuous/bentcigar.html

Large diffs are not rendered by default.

261 changes: 94 additions & 167 deletions _modules/pycellga/problems/single_objective/continuous/bohachevsky.html

Large diffs are not rendered by default.

251 changes: 88 additions & 163 deletions _modules/pycellga/problems/single_objective/continuous/chichinadze.html

Large diffs are not rendered by default.

267 changes: 95 additions & 172 deletions _modules/pycellga/problems/single_objective/continuous/dropwave.html

Large diffs are not rendered by default.

261 changes: 96 additions & 165 deletions _modules/pycellga/problems/single_objective/continuous/fms.html

Large diffs are not rendered by default.

260 changes: 85 additions & 175 deletions _modules/pycellga/problems/single_objective/continuous/griewank.html

Large diffs are not rendered by default.

254 changes: 91 additions & 163 deletions _modules/pycellga/problems/single_objective/continuous/holzman.html

Large diffs are not rendered by default.

281 changes: 106 additions & 175 deletions _modules/pycellga/problems/single_objective/continuous/levy.html

Large diffs are not rendered by default.

249 changes: 91 additions & 158 deletions _modules/pycellga/problems/single_objective/continuous/matyas.html

Large diffs are not rendered by default.

262 changes: 90 additions & 172 deletions _modules/pycellga/problems/single_objective/continuous/pow.html

Large diffs are not rendered by default.

267 changes: 97 additions & 170 deletions _modules/pycellga/problems/single_objective/continuous/powell.html

Large diffs are not rendered by default.

231 changes: 81 additions & 150 deletions _modules/pycellga/problems/single_objective/continuous/rastrigin.html

Large diffs are not rendered by default.

253 changes: 88 additions & 165 deletions _modules/pycellga/problems/single_objective/continuous/rosenbrock.html

Large diffs are not rendered by default.

266 changes: 103 additions & 163 deletions _modules/pycellga/problems/single_objective/continuous/rothellipsoid.html

Large diffs are not rendered by default.

257 changes: 94 additions & 163 deletions _modules/pycellga/problems/single_objective/continuous/schaffer.html

Large diffs are not rendered by default.

253 changes: 94 additions & 159 deletions _modules/pycellga/problems/single_objective/continuous/schaffer2.html

Large diffs are not rendered by default.

254 changes: 92 additions & 162 deletions _modules/pycellga/problems/single_objective/continuous/schwefel.html

Large diffs are not rendered by default.

250 changes: 95 additions & 155 deletions _modules/pycellga/problems/single_objective/continuous/sphere.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

222 changes: 82 additions & 140 deletions _modules/pycellga/problems/single_objective/continuous/threehumps.html

Large diffs are not rendered by default.

239 changes: 94 additions & 145 deletions _modules/pycellga/problems/single_objective/continuous/zakharov.html

Large diffs are not rendered by default.

254 changes: 106 additions & 148 deletions _modules/pycellga/problems/single_objective/continuous/zettle.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

257 changes: 116 additions & 141 deletions _modules/pycellga/problems/single_objective/discrete/binary/ecc.html

Large diffs are not rendered by default.

285 changes: 111 additions & 174 deletions _modules/pycellga/problems/single_objective/discrete/binary/fms.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

221 changes: 74 additions & 147 deletions _modules/pycellga/problems/single_objective/discrete/binary/mmdp.html

Large diffs are not rendered by default.

226 changes: 76 additions & 150 deletions _modules/pycellga/problems/single_objective/discrete/binary/one_max.html

Large diffs are not rendered by default.

263 changes: 87 additions & 176 deletions _modules/pycellga/problems/single_objective/discrete/binary/peak.html

Large diffs are not rendered by default.

300 changes: 105 additions & 195 deletions _modules/pycellga/problems/single_objective/discrete/permutation/tsp.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/arithmetic_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/blxalpha_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/byte_one_point_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/byte_uniform_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/flat_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/linear_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/one_point_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/pmx_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/two_point_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/unfair_avarage_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/recombination/uniform_crossover.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/selection/roulette_wheel_selection.html

Large diffs are not rendered by default.

182 changes: 56 additions & 126 deletions _modules/pycellga/selection/tournament_selection.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ promoting diversity and maintaining a balance between exploration and exploitati
`pycellga` has machine coded operators with byte implementations. Beside it has Alpha-male CGA,
Machine Coded Compact CGA and Improved CGA with Machine Coded Operators for real-valued optimization problems.

.. image:: images/cycle_cga.png
:scale: 40%
:alt: Reproductive cycle of an individual in cGA
:align: center


A representation of the reproductive cycle of an individual in a cellular genetic algorithm.

.. toctree::
:maxdepth: 1
:caption: Table of Contents :
Expand Down
66 changes: 0 additions & 66 deletions _sources/pycellga.example.rst.txt

This file was deleted.

69 changes: 55 additions & 14 deletions _sources/pycellga.mutation.rst.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,54 @@
Mutation Operators
==============================
==================

The `pycellga.mutation` module provides a comprehensive set of mutation operators designed to introduce variation into the population during the genetic algorithm optimization process. Each operator serves a unique purpose based on the representation of the chromosome (binary, real-valued, or permutation-based) and the specific requirements of the optimization problem.
Mutation operators introduce variation into the population by modifying one or more genes of an individual. In cellular genetic algorithms (CGAs), mutation is a key mechanism that ensures diversity and enables exploration of the solution space, preventing premature convergence.

This module includes the following mutation operators:
**Understanding Mutation**
--------------------------

Mutation in genetic algorithms mimics the natural process of genetic mutation, where random changes occur in an individual’s genome. These changes help the algorithm discover new solutions and improve its overall performance.

**The Role of Mutation in CGA**

- **Diversity Preservation**: Mutation ensures that the population does not converge prematurely to suboptimal solutions.
- **Exploration**: Introduces new solutions to explore unexplored regions of the solution space.
- **Fine-Tuning**: Makes small adjustments to solutions, aiding in reaching optimal solutions.

**Mutation Examples**
--------------------------

Below is an example of a **Bit-Flip Mutation** applied to a binary chromosome:

.. image:: images/bit_flip_mutation.png
:scale: 50%
:alt: Bit-flip Mutation Structure
:align: center

Figure 1: Bit-flip mutation flips a single gene in a binary chromosome.

Another example is the **Swap Mutation**, often used for permutation-based problems. It swaps two genes, introducing a small but significant change in the chromosome:

.. image:: images/swap_mutation.png
:scale: 50%
:align: center

Figure 2: Swap mutation changes the order of two genes in a chromosome.

**Common Mutation Types**

1. **Bit-Flip Mutation**: Flips a bit in binary-encoded chromosomes.
2. **Swap Mutation**: Exchanges two genes in permutation-based chromosomes.
3. **Byte Mutation**: Applies byte-level changes to real-valued genes.
4. **Two-Opt Mutation**: Reverses a segment of the chromosome, particularly useful in path optimization.


**API References**
------------------

The following sections provide detailed documentation for the mutation operators available in the `pycellga.mutation` package.

**Bit Flip Mutation**
------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^

Applies a bitwise flip to binary-encoded chromosomes. This operator is a classic choice for binary genetic algorithms, offering a simple yet effective mutation approach.

Expand All @@ -15,8 +57,8 @@ Applies a bitwise flip to binary-encoded chromosomes. This operator is a classic
:undoc-members:
:show-inheritance:

**Byte-Level Mutation**
------------------------------
**Byte Mutation**
^^^^^^^^^^^^^^^^^^^^^^^^

Performs mutations at the byte level for real-valued chromosomes. This operator leverages byte manipulation to create small, precise adjustments in the solution space, optimizing the algorithm's performance for continuous functions.

Expand All @@ -26,7 +68,7 @@ Performs mutations at the byte level for real-valued chromosomes. This operator
:show-inheritance:

**Randomized Byte Mutation**
------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Introduces randomness at the byte level, enabling broader exploration in real-valued optimization tasks. This operator is particularly effective when a high degree of variation is desirable.

Expand All @@ -36,7 +78,7 @@ Introduces randomness at the byte level, enabling broader exploration in real-va
:show-inheritance:

**Uniform Float Mutation**
------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Applies uniform random mutations across real-valued chromosomes. This operator is suitable for continuous optimization, where each gene is adjusted within a defined range to enhance solution diversity.

Expand All @@ -46,7 +88,7 @@ Applies uniform random mutations across real-valued chromosomes. This operator i
:show-inheritance:

**Insertion-Based Mutation**
------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

A mutation strategy tailored for permutation-based representations, such as in sequencing and scheduling problems. This operator repositions a randomly selected gene within the chromosome, altering the order while preserving elements.

Expand All @@ -57,7 +99,7 @@ A mutation strategy tailored for permutation-based representations, such as in s


**Shuffle Mutation**
------------------------------
^^^^^^^^^^^^^^^^^^^^^^^^

Randomly rearranges a subset of genes in the chromosome. This operator is effective in permutation-based problems, promoting diversity by shuffling segments without altering individual gene values.

Expand All @@ -67,7 +109,7 @@ Randomly rearranges a subset of genes in the chromosome. This operator is effect
:show-inheritance:

**Swap Mutation**
-------------------
^^^^^^^^^^^^^^^^^^^^^^^^

Swaps the positions of two genes, introducing subtle changes ideal for permutation-based optimizations. This operator is commonly applied in combinatorial problems where order is significant.

Expand All @@ -77,12 +119,11 @@ Swaps the positions of two genes, introducing subtle changes ideal for permutati
:show-inheritance:

**Two-Opt Mutation**
----------------------
^^^^^^^^^^^^^^^^^^^^^^^^

A mutation operator frequently used in path optimization problems, such as the Traveling Salesman Problem. It reverses a segment of the chromosome, allowing for new path configurations without altering the gene order.

.. automodule:: pycellga.mutation.two_opt_mutation
:members:
:undoc-members:
:show-inheritance:

:show-inheritance:
92 changes: 76 additions & 16 deletions _sources/pycellga.neighborhoods.rst.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,126 @@
Neighborhood Operators
==================================
=======================

The `pycellga.neighborhoods` module provides various neighborhood structures that define how individuals interact with their neighbors in the cellular genetic algorithm (CGA). These neighborhood operators are essential for managing the flow of information and maintaining diversity within the population.
Each neighborhood module defines a specific spatial structure. Depending on the problem and the desired interaction level, users can select different neighborhood sizes and arrangements.
This module provides various neighborhood structures for cellular genetic algorithms (CGAs). Neighborhood structures define how individuals interact with others in their immediate vicinity, playing a critical role in regulating the flow of information and maintaining diversity within the population.

In cellular genetic algorithms, the concept of neighborhoods is integral to the evolutionary process. As shown in the diagram below, each individual in the population interacts with its neighbors during key stages of the evolutionary cycle: Selection, Recombination, Mutation, and Replacement. This localized interaction helps balance exploration and exploitation, promoting better local optimization while preserving diversity.

.. image:: images/cycle_cga.png
:scale: 40%
:alt: Reproductive cycle of an individual in cGA
:align: center

Figure 1: A representation of the reproduction cycle with neighborhood structure in a cellular genetic algorithm.

The neighborhood structure governs which individuals are selected for interactions during the evolutionary cycle. Depending on the problem requirements, users can choose different types of neighborhoods, such as linear or compact structures, to optimize the algorithm's performance.


**The Concept of Neighborhood**
-------------------------------

Neighborhood refers to a spatial structure used to improve solutions in optimization problems. In most cases, the neighborhood of a solution represents solutions obtained through small modifications.

Below are some popular neighborhood structures:

- **Linear Neighborhood**: Individuals interact with neighbors arranged in a straight line.
- **Compact Neighborhood**: A structure formed by cells surrounding an individual, allowing denser interaction.

**Why Use Different Structures?**

Each neighborhood structure is suited for specific problem types:
- **Linear structures** are more appropriate for sequential or ordered problems.
- **Compact structures** are ideal for scenarios requiring dense information sharing and local exploration.


**Neighborhood Scheme Examples**
------------------------

**Linear Neighborhood**
A linear neighborhood structure refers to an arrangement where individuals interact with a specific number of neighbors in a straight line. For instance, consider a linear structure with 5 neighbors:

.. image:: images/linear_5_example.png
:scale: 40%
:alt: Linear 5 Neighborhood Structure
:align: center

Figure 2: Linear 5 Neighborhood Structure

Each individual shares information only with its immediate neighbors. This structure is suitable for cases requiring limited information flow.

**Compact Neighborhood**
Compact structures involve individuals sharing information intensively with all their surrounding neighbors. Below is an example of a compact structure with 9 neighbors:

.. image:: images/compact_9_example.png
:scale: 40%
:alt: Compact 9 Neighborhood Structure
:align: center

Figure 3: Compact 9 Neighborhood Structure

This structure can achieve faster convergence but must be used cautiously to maintain diversity.


**API References**
------------------

The following sections provide detailed documentation for the neighborhood operators available in the `pycellga.neighborhoods` package.

**Linear 5**
--------------
^^^^^^^^^^^^

Defines a linear neighborhood where each individual interacts with 5 neighbors arranged in a line. This structure is suitable for problems where limited, sequential interaction is beneficial.
Description: A structure with 5 neighbors in a linear arrangement.

.. automodule:: pycellga.neighborhoods.linear_5
:members:
:undoc-members:
:show-inheritance:

**Linear 9**
--------------
^^^^^^^^^^^^

A linear arrangement with 9 neighbors, encouraging a higher level of information flow along a line. This structure is ideal for applications that require extended sequential interactions.
Description: A linear arrangement with 9 neighbors for greater information flow.

.. automodule:: pycellga.neighborhoods.linear_9
:members:
:undoc-members:
:show-inheritance:

**Compact 9**
--------------
^^^^^^^^^^^^^

A compact neighborhood structure with 9 neighbors. This layout offers dense interaction among individuals, facilitating rapid convergence while maintaining diversity.
Description: A compact structure with 9 neighbors for dense interaction.

.. automodule:: pycellga.neighborhoods.compact_9
:members:
:undoc-members:
:show-inheritance:

**Compact 13**
--------------
^^^^^^^^^^^^^^

Defines a compact neighborhood structure where each individual interacts with its immediate and extended neighbors in a 13 grid. This structure allows moderate information sharing across neighboring cells.
Description: A compact structure with 13 neighbors.

.. automodule:: pycellga.neighborhoods.compact_13
:members:
:undoc-members:
:show-inheritance:

**Compact 21**
--------------
^^^^^^^^^^^^^^

Provides a compact arrangement where individuals have a 21 neighborhood structure. This layout encourages local exploration and is useful in tightly clustered populations.
Description: A compact structure with 21 neighbors for broader information sharing.

.. automodule:: pycellga.neighborhoods.compact_21
:members:
:undoc-members:
:show-inheritance:

**Compact 25**
--------------
^^^^^^^^^^^^^^

An extended compact neighborhood that includes more neighbors, with a 25 structure. This layout promotes broader information sharing, enhancing convergence in larger populations.
Description: An extended compact structure with 25 neighbors for enhanced information sharing.

.. automodule:: pycellga.neighborhoods.compact_25
:members:
:undoc-members:
:show-inheritance:
:show-inheritance:
Loading

0 comments on commit f5f5c63

Please sign in to comment.