From 002772c71fccba6fb087a6e9180d537d80345d9e Mon Sep 17 00:00:00 2001 From: danielwilczak101 <44122838+danielwilczak101@users.noreply.github.com> Date: Thu, 1 Oct 2020 01:22:53 -0400 Subject: [PATCH] Updated comments on crossover and selection --- src/crossover/examples.py | 16 ++++++++++++++-- src/selection/examples.py | 15 +++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/crossover/examples.py b/src/crossover/examples.py index 25d91c8..5b64d81 100644 --- a/src/crossover/examples.py +++ b/src/crossover/examples.py @@ -1,3 +1,15 @@ class crossover_examples: - """Crossover examples will go here """ - pass + """ Crossover explination goes here. + + Points - Defined as sections between the chromosomes genetic makeup + """ + + def single_point_crossover(ga): + """Single point crossover is when a "point" is selected and the genetic + make up of the two parent chromosomes are "Crossed" or better known as swapped""" + pass + + def multi_point_crossover(ga,number_of_points = 2): + """Multi point crossover is when a specific number (More then one) of + "points" are created to merge the genetic makup of the chromosomes.""" + pass diff --git a/src/selection/examples.py b/src/selection/examples.py index 8920f7d..102fc5a 100644 --- a/src/selection/examples.py +++ b/src/selection/examples.py @@ -1,3 +1,14 @@ class selection_examples: - """Selection examples will go here """ - pass + """Selection defintion here""" + + def tournament_selection(): + """ """ + pass + + def roulette_selection(): + """Roulette selection works based off of how strong the fitness is of the + chromosomes in the population. The stronger the fitness the higher the probability + that it will be selected. Using the example of a casino roulette wheel. + Where the chromosomes are the numbers to be selected and the board size for + those numbers are directly proportional to the chromosome's current fitness.""" + pass