diff --git a/.gitignore b/.gitignore
index bee8a64..322d18e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
__pycache__
+yolov3.weights
diff --git a/.idea/misc.xml b/.idea/misc.xml
index a2e120d..8fda991 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index a3c438b..b74c797 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,7 +5,10 @@
+
+
+
@@ -23,60 +26,10 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -85,10 +38,76 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -104,9 +123,6 @@
- self
- gen
- data.geny
crosso
fitness
wybierzUnbox
@@ -131,9 +147,12 @@
podajDwaChromosomy
generuj
populacjaF
- rys
- data
populacjaFitness
+ data
+ print
+ graphviz
+ key
+ rys
@@ -154,10 +173,8 @@
-
-
@@ -168,18 +185,21 @@
-
-
-
+
+
+
+
+
+
-
+
-
-
+
+
@@ -190,6 +210,7 @@
+
@@ -201,11 +222,10 @@
-
-
+
@@ -337,8 +357,8 @@
-
+
@@ -370,18 +390,18 @@
-
+
-
+
-
+
-
+
@@ -418,10 +438,25 @@
+
+ file://$PROJECT_DIR$/program.py
+ 90
+
+
+
+ file://$PROJECT_DIR$/funkcje.py
+ 233
+
+
file://$PROJECT_DIR$/genetyczne.py
- 26
-
+ 33
+
+
+
+ file://$PROJECT_DIR$/program.py
+ 104
+
@@ -450,13 +485,6 @@
-
-
-
-
-
-
-
@@ -494,27 +522,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -553,14 +560,6 @@
-
-
-
-
-
-
-
-
@@ -588,33 +587,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -622,12 +597,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -635,52 +714,39 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AStar.py b/AStar.py
index d0ecf9c..6b13cd4 100644
--- a/AStar.py
+++ b/AStar.py
@@ -79,7 +79,7 @@ class AStar:
else:
child.g = current.g + cost
child.h = (((child.position[0]-endNode.position[0]) ** 2) + ((child.position[1]-endNode.position[1]) ** 2))
- child.f = child.g + child.h
+ child.f = child .g + child.h
if len([i for i in toVisit if child==i and child.g>i.g])>0:
continue
diff --git a/__pycache__/AStar.cpython-37.pyc b/__pycache__/AStar.cpython-37.pyc
index 0e29d9d..e733c82 100644
Binary files a/__pycache__/AStar.cpython-37.pyc and b/__pycache__/AStar.cpython-37.pyc differ
diff --git a/__pycache__/funkcje.cpython-37.pyc b/__pycache__/funkcje.cpython-37.pyc
index d134230..c88b048 100644
Binary files a/__pycache__/funkcje.cpython-37.pyc and b/__pycache__/funkcje.cpython-37.pyc differ
diff --git a/__pycache__/genetyczne.cpython-37.pyc b/__pycache__/genetyczne.cpython-37.pyc
index 483b4f9..6bcc9a2 100644
Binary files a/__pycache__/genetyczne.cpython-37.pyc and b/__pycache__/genetyczne.cpython-37.pyc differ
diff --git a/__pycache__/program.cpython-37.pyc b/__pycache__/program.cpython-37.pyc
index c549a5b..b454877 100644
Binary files a/__pycache__/program.cpython-37.pyc and b/__pycache__/program.cpython-37.pyc differ
diff --git a/funkcje.py b/funkcje.py
index aa3d960..00c638b 100644
--- a/funkcje.py
+++ b/funkcje.py
@@ -4,7 +4,7 @@ from AStar import AStar
import random
from easygui import *
import matplotlib.pyplot as plt
-
+from Data import Data
@@ -81,17 +81,6 @@ def zbierzBox(gen,data, moves, kordStartowy):
break
-def rysujWykres(data, x, yStart, yEnd):
-
- plt.axis([0, x,yStart, yEnd])
-
- for i in range(0, len(data.doWykresu) - 1):
- y = data.doWykresu[i]
- x = i
- plt.scatter(x, y)
- #plt.pause(0.0001)
-
- plt.show()
def znajdzUnbox(data,mapa):
@@ -230,3 +219,18 @@ def okno():
except:
return 0
+
+
+def rysujWykres(data):
+ x = list(range(len(data.doWykresu)))
+ y = data.doWykresu
+ plt.scatter(x, y, marker= "o", color = "r")
+ plt.show()
+"""
+data = Data()
+data.doWykresu = [1,2,3]
+x = list(range(1, len(data.doWykresu)+ 1))
+y = data.doWykresu
+rysujWykres(data,x)
+print(x)
+"""
\ No newline at end of file
diff --git a/genetyczne.py b/genetyczne.py
index 29b5b31..212fb8b 100644
--- a/genetyczne.py
+++ b/genetyczne.py
@@ -9,7 +9,7 @@ def start(data, wheel, dane):
mutacja = float(dane[2])
unbox = int(dane[3])
"""
- ileGeneracji = 1000
+ ileGeneracji = 200
ileWPopulacji = 16
fragment = 0.5
mutacja = 0.05
@@ -31,7 +31,7 @@ def start(data, wheel, dane):
data.histZmian.append(data.best[1])
- rysujWykres(data, ileGeneracji, 0, 2000)
+ #rysujWykres(data)
diff --git a/main.py b/main.py
index 203a490..c93d38d 100644
--- a/main.py
+++ b/main.py
@@ -5,6 +5,7 @@ import os;
def main():
good = False
+
while (True):
good = True
@@ -35,7 +36,6 @@ def main():
if good:
window = MainWindow(int(fieldValues[0]), int(fieldValues[1]), int(fieldValues[2]), int(fieldValues[3]), int(fieldValues[4]), int(fieldValues[5]));
break
-
"""
szerokosc = 15#min 6
wysokosc = 10 #min 7
diff --git a/program.py b/program.py
index 2d0b9b0..88dde36 100644
--- a/program.py
+++ b/program.py
@@ -102,8 +102,9 @@ class MainWindow:
kordStartowy = self.data.unbox[gen.unboxWczesniejszegoGenu]
zbierzBox(gen,self.data, self.moves, kordStartowy)
+ self.data.__init__()
elif(event.key== pygame.K_r):
- self.map = randomBox(self.map, self.regals, 20)
+ self.map = randomBox(self.map, self.regals, 2)
updateMap(self.data, self.map, self.mapForAStar, self.regals)
elif len(self.moves)==0:
self.wheel.move(event, self.map)