GenericAI_Sweeper/generate_examples.py
eugenep 74788bbc94 examples
Co-authored-by: Sebastian Piotrowski <sebpio@st.amu.edu.pl>
Co-authored-by: Ladislaus3III <Ladislaus3III@users.noreply.github.com>
Co-authored-by: Marcin Matoga <marmat35@st.amu.edu.pl>
2021-05-15 15:28:45 +02:00

71 lines
2.3 KiB
Python

#author: Kuba Henyk
import random
class ExampleGenerator():
@staticmethod
def generate():
list = [[]]
for i in range(1000):
while True:
c = [random.randrange(0, 21), random.randrange(5, 41), random.randrange(1, 61), random.randrange(0, 11), random.randrange(0, 2), random.randrange(0, 2), random.randrange(0, 2), random.randrange(0, 2)]
if c in list:
continue
else:
break
list.append(c)
f = open("dane.txt", "w")
for i in range(len(list)):
if i != 0:
#glebokosc
if list[i][0] <= 19:
#rozmiar
if list[i][1] <= 39:
#masa
if list[i][2] <= 58:
#moc
if list[i][3] <= 9:
#szkodliwosc
if list[i][4] == 1:
#zabawka
if list[i][5] == 1:
#stan
if list[i][6] == 1:
#teledysk
if list[i][7] == 1:
list[i].append(2)
else:
list[i].append(5)
else:
list[i].append(4)
else:
list[i].append(3)
else:
list[i].append(1)
else:
list[i].append(1)
else:
list[i].append(1)
else:
list[i].append(1)
else:
list[i].append(1)
for i in range(len(list)):
if i == 0:
continue
else:
for j in range(len(list[i])):
f.write(str(list[i][j]) + ' ')
f.write("\n")
f.close()