Dodanie trybu macierzy testowej

This commit is contained in:
Marcin Kwapisz 2020-05-07 18:25:08 +02:00
parent 86ce81245b
commit c2237e1eba
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,5 @@
# import tensorflow
class main():
def __init__(self,traktor,field,ui,path):
self.traktor = traktor

View File

@ -2,8 +2,22 @@ import numpy
import random
class field():
def __init__(self):
self.field_matrix = numpy.random.randint(0, 9, (10, 10))
def __init__(self,training=0):
self.training = training
if self.training == 1:
#Macierz treningowa
self.field_matrix = numpy.array([[8,0,1,3,0,6,4,3,2,3],
[1,4,8,3,7,7,8,5,1,5],
[8,7,6,0,4,0,7,7,5,0],
[5,4,8,0,5,3,8,1,7,7],
[6,0,2,3,2,0,6,6,2,2],
[5,8,8,5,4,3,3,1,5,8],
[7,8,7,1,5,7,8,0,4,8],
[7,3,6,6,0,0,5,6,1,2],
[7,2,8,7,1,2,5,3,2,4],
[2,4,6,7,6,7,3,5,4,6]])
else:
self.field_matrix = numpy.random.randint(0, 9, (10, 10))
print("Reprezentacja pola jako macierz:")
print("###################")
for i in self.field_matrix: