Skip to content

Commit

Permalink
deleted unused libraries and changed order of variables and methods f…
Browse files Browse the repository at this point in the history
…or better clarity
  • Loading branch information
Jacodian committed Dec 3, 2018
1 parent dd76061 commit 99d083c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 9 deletions.
3 changes: 0 additions & 3 deletions GeneticAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def __init__(self,mutationRate, populationSize, fitnessFunction, numberOfGenes,
self.k = populationSize//2




def startAlgorithm(self):
self.popCreation()
while True:
Expand All @@ -45,7 +43,6 @@ def startAlgorithm(self):
self.best = self.population[self.popFitness.index(max(self.popFitness))]

if self.stopCondition(self):

break
self.reproduction()
self.numberOfGenerations+=1
Expand Down
1 change: 0 additions & 1 deletion README.md

This file was deleted.

Binary file modified __pycache__/GeneticAlgorithm.cpython-36.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion best_path_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def stopCondition(algorithmInstance):
ga.startAlgorithm()
end = time.time()
print("time elapsed: "+str(end - start))
print(ga.best)
plt.figure(1)
plt.plot(ga.generation, ga.bestFitness)
plt.xlabel('Generation')
Expand Down
5 changes: 1 addition & 4 deletions bit_sequence_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
"""


import numpy as np
from random import randint
from random import random
from GeneticAlgorithm import GeneticAlgorithm
import time
import matplotlib.pyplot as plt


bitSequence="01011111100101011001010010101"
geneValues=["0","1"]

#hiperparameters
mutationRate = 0.05
Expand All @@ -24,6 +20,7 @@
#stopCondition Parameters
maxGenerations=100

geneValues=["0","1"]
def fitnessFunction(individual):
total=0
for i in range(len(individual)):
Expand Down

0 comments on commit 99d083c

Please sign in to comment.