Decision Tree
This commit is contained in:
parent
24a18662c7
commit
d30612dfc7
45
bin/Classess/DecisionTree.py
Normal file
45
bin/Classess/DecisionTree.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import pandas as pd
|
||||||
|
from sklearn.model_selection import train_test_split
|
||||||
|
from sklearn.tree import DecisionTreeClassifier
|
||||||
|
from sklearn.metrics import classification_report, confusion_matrix
|
||||||
|
from joblib import dump, load
|
||||||
|
|
||||||
|
|
||||||
|
class DecisionTree:
|
||||||
|
def __init__(self):
|
||||||
|
self.classifier = load('../../files/decision tree/classifier.joblib')
|
||||||
|
|
||||||
|
|
||||||
|
def Learning():
|
||||||
|
# Uploading data from file
|
||||||
|
dataset = pd.read_csv("../../files/decision tree/database.csv")
|
||||||
|
|
||||||
|
print(f'Shape: {dataset.shape}')
|
||||||
|
print(f'Head:\n{dataset.head()}')
|
||||||
|
|
||||||
|
X = dataset.drop('decision', axis=1)
|
||||||
|
y = dataset['decision']
|
||||||
|
|
||||||
|
# Split data to training and test sets
|
||||||
|
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.10)
|
||||||
|
|
||||||
|
# Training
|
||||||
|
classifier = DecisionTreeClassifier()
|
||||||
|
classifier.fit(X_train, y_train)
|
||||||
|
|
||||||
|
# Predictions test
|
||||||
|
y_pred = classifier.predict(X_test)
|
||||||
|
# print(y_pred)
|
||||||
|
|
||||||
|
# my_dict = {'known': [1], 'power': [1], 'new': [1], 'location': [0], 'stable': [1], 'chain_reaction': [1]}
|
||||||
|
# s = pd.DataFrame.from_dict(my_dict)
|
||||||
|
# predict = self.classifier.predict(s)
|
||||||
|
#
|
||||||
|
# print(predict)
|
||||||
|
|
||||||
|
print()
|
||||||
|
print(confusion_matrix(y_test, y_pred))
|
||||||
|
print(classification_report(y_test, y_pred))
|
||||||
|
|
||||||
|
dump(classifier, '../../files/decision tree/classifier.joblib')
|
||||||
|
|
@ -24,12 +24,16 @@ class Field(object):
|
|||||||
self.columns = 10
|
self.columns = 10
|
||||||
self.x_start = 5
|
self.x_start = 5
|
||||||
self.y_start = 5
|
self.y_start = 5
|
||||||
self.state_of_cell_array = [[0 for i in range(3)] for j in range(200)]
|
# For red and green rectangles
|
||||||
|
# self.state_of_cell_array = [[0 for i in range(3)] for j in range(200)]
|
||||||
|
# Is on this position mine (True, False)
|
||||||
self.field_state_array = [[False for i in range(self.rows)] for j in range(self.columns)]
|
self.field_state_array = [[False for i in range(self.rows)] for j in range(self.columns)]
|
||||||
self.small_image_array = [[0 for i in range(self.rows)] for j in range(self.columns)]
|
self.small_image_array = [[0 for i in range(self.rows)] for j in range(self.columns)]
|
||||||
self.large_image_array = [[0 for i in range(self.rows)] for j in range(self.columns)]
|
self.large_image_array = [[0 for i in range(self.rows)] for j in range(self.columns)]
|
||||||
self.cell_expense = [0 for i in range(self.rows * self.columns)]
|
self.cell_expense = [0 for i in range(self.rows * self.columns)]
|
||||||
self.visited_mines = []
|
# Array rows * columns, if on [x][y] mine, object mine will be in the array in this position
|
||||||
|
self.state_of_cell_array = [["None" for _ in range(self.rows)] for __ in range(self.columns)]
|
||||||
|
# self.visited_mines = []
|
||||||
|
|
||||||
# Modified by Artem to search in the status area
|
# Modified by Artem to search in the status area
|
||||||
self.canvas_small_images = []
|
self.canvas_small_images = []
|
||||||
@ -47,7 +51,11 @@ class Field(object):
|
|||||||
bg='gray')
|
bg='gray')
|
||||||
self.large_image_canvas.place(x=FRAME_WIDTH + 5, y=3)
|
self.large_image_canvas.place(x=FRAME_WIDTH + 5, y=3)
|
||||||
|
|
||||||
self.flag_img = PhotoImage(master=self.small_field_canvas, file="../../files/flag/Flaga.png")
|
self.flag_img = PhotoImage(master=self.small_field_canvas, file="../../files/flag/FlagRed.png")
|
||||||
|
self.flag_green_img = PhotoImage(master=self.small_field_canvas, file="../../files/flag/FlagGreen.png")
|
||||||
|
self.flag_yellow_img = PhotoImage(master=self.small_field_canvas, file="../../files/flag/FlagYellow.png")
|
||||||
|
self.flag_red_img = PhotoImage(master=self.small_field_canvas, file="../../files/flag/FlagRed.png")
|
||||||
|
self.flag_bleu_img = PhotoImage(master=self.small_field_canvas, file="../../files/flag/FlagBlue.png")
|
||||||
|
|
||||||
# Clear Canvases
|
# Clear Canvases
|
||||||
def Moving(self):
|
def Moving(self):
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
class Mine:
|
class Mine:
|
||||||
def __init__(self, x, y):
|
def __init__(self, x, y, known, power, new, location, stable):
|
||||||
self.array_x = x
|
self.array_x = x
|
||||||
self.array_y = y
|
self.array_y = y
|
||||||
self.status = True
|
self.status = True
|
||||||
self.small_img = None
|
self.small_img = None
|
||||||
self.large_img = None
|
self.large_img = None
|
||||||
|
|
||||||
|
# Attributes for decision tree
|
||||||
|
self.known = known # 0 - 'no', 1 - 'yes'
|
||||||
|
self.power = power # 0 - 'no', 1 - 'yes'
|
||||||
|
self.new = new # 0 - 'no', 1 - 'yes'
|
||||||
|
self.location = location # 0 - 'standard', 1 - 'sand', 2 - 'water', 3 - 'swamp'
|
||||||
|
self.stable = stable # 0 - 'no', 1 - 'yes'
|
||||||
|
self.chain_reaction = 0 # 0 - 'no', 1 - 'yes'
|
||||||
|
BIN
bin/Classess/__pycache__/DecisionTree.cpython-37.pyc
Normal file
BIN
bin/Classess/__pycache__/DecisionTree.cpython-37.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
9
bin/Main/LearnDecisionTree.py
Normal file
9
bin/Main/LearnDecisionTree.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
from bin.Classess.DecisionTree import Learning
|
||||||
|
|
||||||
|
|
||||||
|
def LearnDecisionTree():
|
||||||
|
Learning()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
LearnDecisionTree()
|
Binary file not shown.
Binary file not shown.
15
bin/Main/test.py
Normal file
15
bin/Main/test.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
my_dict = {'known': [1], 'power': [1], 'new': [1], 'location': 0, 'stable': [1], 'chain_reaction': [1]}
|
||||||
|
|
||||||
|
s = pd.DataFrame.from_dict(my_dict)
|
||||||
|
|
||||||
|
print(s)
|
||||||
|
|
||||||
|
# data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
|
||||||
|
# print(pd.DataFrame.from_dict(data))
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
231
bin/main/main.py
231
bin/main/main.py
@ -2,6 +2,7 @@ import os
|
|||||||
import random
|
import random
|
||||||
import time
|
import time
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
from bin.Classess.Field import Field
|
from bin.Classess.Field import Field
|
||||||
from bin.Classess.Mine import Mine
|
from bin.Classess.Mine import Mine
|
||||||
@ -10,6 +11,7 @@ from bin.Classess.Player import Player
|
|||||||
import bin.Classess.Node as nd
|
import bin.Classess.Node as nd
|
||||||
import bin.Classess.Travel as tr
|
import bin.Classess.Travel as tr
|
||||||
from resources.Globals import *
|
from resources.Globals import *
|
||||||
|
from bin.Classess.DecisionTree import DecisionTree
|
||||||
|
|
||||||
# WINDOW_X = 533 + 1200
|
# WINDOW_X = 533 + 1200
|
||||||
# WINDOW_Y = 950
|
# WINDOW_Y = 950
|
||||||
@ -27,12 +29,16 @@ from resources.Globals import *
|
|||||||
player = Player()
|
player = Player()
|
||||||
field = Field()
|
field = Field()
|
||||||
travel = Travel()
|
travel = Travel()
|
||||||
|
decision_tree = DecisionTree()
|
||||||
|
|
||||||
|
# Globals
|
||||||
fringe = []
|
fringe = []
|
||||||
explored = []
|
explored = []
|
||||||
action_list = []
|
action_list = []
|
||||||
images_coord = []
|
images_coord = []
|
||||||
|
|
||||||
|
label = None
|
||||||
|
|
||||||
|
|
||||||
def Arrow(direction):
|
def Arrow(direction):
|
||||||
image = ""
|
image = ""
|
||||||
@ -62,18 +68,17 @@ def Fill(bool):
|
|||||||
|
|
||||||
print(travel.points_map)
|
print(travel.points_map)
|
||||||
|
|
||||||
|
|
||||||
for i in range(0, len(field.canvas_small_images)):
|
for i in range(0, len(field.canvas_small_images)):
|
||||||
images_coord.append(field.small_field_canvas.coords(field.canvas_small_images[i]))
|
images_coord.append(field.small_field_canvas.coords(field.canvas_small_images[i]))
|
||||||
# print("Coords List: ", images_coord)
|
# print("Coords List: ", images_coord)
|
||||||
|
|
||||||
nd.init_data(images_coord, field.cell_expense)
|
nd.init_data(images_coord, field.cell_expense)
|
||||||
|
|
||||||
# Drawing red/green rectangles
|
# # Drawing red/green rectangles
|
||||||
for el in field.state_of_cell_array:
|
# for el in field.state_of_cell_array:
|
||||||
if el[0] != 0:
|
# if el[0] != 0:
|
||||||
field.small_field_canvas.create_rectangle(el[0], el[1], el[0] + player.step - 2,
|
# field.small_field_canvas.create_rectangle(el[0], el[1], el[0] + player.step - 2,
|
||||||
el[1] + player.step - 2, width=3, outline=el[2])
|
# el[1] + player.step - 2, width=3, outline=el[2])
|
||||||
|
|
||||||
DrawingLargeImage()
|
DrawingLargeImage()
|
||||||
|
|
||||||
@ -179,11 +184,11 @@ def CellDesignation(array, color):
|
|||||||
def Action(action):
|
def Action(action):
|
||||||
if action in ["Right", "Left", "Up", "space"]:
|
if action in ["Right", "Left", "Up", "space"]:
|
||||||
Moving(action)
|
Moving(action)
|
||||||
elif action in ["1", "2"]:
|
# elif action in ["1", "2"]:
|
||||||
if action == "1":
|
# if action == "1":
|
||||||
CellDesignation(field.state_of_cell_array, "red")
|
# CellDesignation(field.state_of_cell_array, "red")
|
||||||
else:
|
# else:
|
||||||
CellDesignation(field.state_of_cell_array, "green")
|
# CellDesignation(field.state_of_cell_array, "green")
|
||||||
|
|
||||||
|
|
||||||
# Modified by Artem to search in the status area
|
# Modified by Artem to search in the status area
|
||||||
@ -199,6 +204,42 @@ def create_action_list(states, index):
|
|||||||
create_action_list(states, states.index(state_parent))
|
create_action_list(states, states.index(state_parent))
|
||||||
|
|
||||||
|
|
||||||
|
def MakeDecision():
|
||||||
|
if player.current_array_x != 0 or player.current_array_y != 0:
|
||||||
|
mine = field.state_of_cell_array[player.current_array_y][player.current_array_x]
|
||||||
|
# print(field.state_of_cell_array)
|
||||||
|
# print(mine)
|
||||||
|
attributes_dict = {'known': [mine.known], 'power': [mine.power], 'new': [mine.new], 'location': [mine.location],
|
||||||
|
'stable': [mine.stable], 'chain_reaction': [mine.chain_reaction]}
|
||||||
|
|
||||||
|
attributes = f'{mine.known}; {mine.power}; {mine.new}; {mine.location}; {mine.stable}; {mine.chain_reaction}'
|
||||||
|
|
||||||
|
global label_text
|
||||||
|
label_text += attributes + '\n'
|
||||||
|
|
||||||
|
global label
|
||||||
|
label.config(text=label_text)
|
||||||
|
field.win.update()
|
||||||
|
|
||||||
|
data_frame = pd.DataFrame.from_dict(attributes_dict)
|
||||||
|
predict = decision_tree.classifier.predict(data_frame)
|
||||||
|
|
||||||
|
return predict
|
||||||
|
|
||||||
|
|
||||||
|
def MarkMine(prediction):
|
||||||
|
if prediction == 0:
|
||||||
|
DrawFlag(field.flag_green_img)
|
||||||
|
if prediction == 1:
|
||||||
|
DrawFlag(field.flag_yellow_img)
|
||||||
|
if prediction == 2:
|
||||||
|
DrawFlag(field.flag_red_img)
|
||||||
|
if prediction == 3:
|
||||||
|
DrawFlag(field.flag_bleu_img)
|
||||||
|
|
||||||
|
field.win.update()
|
||||||
|
|
||||||
|
|
||||||
def MouseClickEvent(track):
|
def MouseClickEvent(track):
|
||||||
global fringe
|
global fringe
|
||||||
global explored
|
global explored
|
||||||
@ -230,7 +271,6 @@ def MouseClickEvent(track):
|
|||||||
explored.clear()
|
explored.clear()
|
||||||
action_list.clear()
|
action_list.clear()
|
||||||
fringe = nd.graph_search_A(fringe, explored, node.state, end_position)
|
fringe = nd.graph_search_A(fringe, explored, node.state, end_position)
|
||||||
# fringe = nd.graph_search(fringe, explored, node.state, end_position)
|
|
||||||
|
|
||||||
states = []
|
states = []
|
||||||
goal_all = []
|
goal_all = []
|
||||||
@ -249,80 +289,39 @@ def MouseClickEvent(track):
|
|||||||
|
|
||||||
create_action_list(states, -1)
|
create_action_list(states, -1)
|
||||||
|
|
||||||
# for i in range(0, len(fringe)):
|
|
||||||
# print('Node{} = State: {} {}, Parent: {} {} {}, Action: {}'.format(i + 1, fringe[i].state.coord, fringe[i].state.direction, fringe[i].parent[0], fringe[i].parent[1], fringe[i].parent[2], fringe[i].action))
|
|
||||||
|
|
||||||
# print(action_list)
|
|
||||||
|
|
||||||
# Start moving
|
# Start moving
|
||||||
AutoMove()
|
AutoMove()
|
||||||
DrawFlag()
|
|
||||||
|
# Decision by tree
|
||||||
|
prediction = MakeDecision()
|
||||||
|
# Draw the right flag
|
||||||
|
MarkMine(prediction)
|
||||||
|
|
||||||
time.sleep(SLEEP_AFTER_CHECK_MINE)
|
time.sleep(SLEEP_AFTER_CHECK_MINE)
|
||||||
|
|
||||||
|
|
||||||
# start_position = field.small_field_canvas.coords(player.image_canvas_id)
|
# Check in which locations is mine
|
||||||
# end_position = []
|
def CheckLocation(x, y):
|
||||||
#
|
# Add x + y like strings that create xy number
|
||||||
# # print("Pierwsza pozycja: {} {}".format(start_position[0], start_position[1]))
|
temp_x = str(x)
|
||||||
#
|
temp_y = str(y)
|
||||||
# for i in range(0, len(field.canvas_small_images)):
|
position_str = temp_x + temp_y
|
||||||
# img_coords = field.small_field_canvas.coords(field.canvas_small_images[i])
|
position = int(position_str)
|
||||||
# if (img_coords[0] <= event.x and event.x <= img_coords[0] + IMAGE_SIZE) and (img_coords[1] <= event.y and event.y <= img_coords[1] + IMAGE_SIZE):
|
|
||||||
# end_position = img_coords
|
color_number = -1
|
||||||
# print("Color cost: ", field.cell_expense[i])
|
if field.cell_expense[position] == standard_cell_cost:
|
||||||
#
|
color_number = 0
|
||||||
# # if len(end_position) == 2:
|
elif field.cell_expense[position] == sand_cell_cost:
|
||||||
# # print("Koncowa pozycja: {} {}".format(end_position[0], end_position[1]))
|
color_number = 1
|
||||||
#
|
elif field.cell_expense[position] == water_cell_cost:
|
||||||
# node = nd.Node()
|
color_number = 2
|
||||||
# if len(fringe) == 0:
|
elif field.cell_expense[position] == swamp_cell_cost:
|
||||||
# node.state.coord = start_position
|
color_number = 3
|
||||||
# node.state.direction = "east"
|
|
||||||
# else:
|
return color_number
|
||||||
# states = []
|
|
||||||
# for k in range(0, len(fringe)):
|
|
||||||
# new_state = fringe[k].state.coord
|
|
||||||
# states.append(new_state)
|
|
||||||
# start_node = fringe[-1]
|
|
||||||
#
|
|
||||||
# node.state.coord = start_node.state.coord
|
|
||||||
# node.state.direction = start_node.state.direction
|
|
||||||
#
|
|
||||||
# fringe.clear()
|
|
||||||
# explored.clear()
|
|
||||||
# action_list.clear()
|
|
||||||
# fringe = nd.graph_search_A(fringe, explored, node.state, end_position)
|
|
||||||
# # fringe = nd.graph_search(fringe, explored, node.state, end_position)
|
|
||||||
#
|
|
||||||
# states = []
|
|
||||||
# goal_all = []
|
|
||||||
# for i in range(0, len(fringe)):
|
|
||||||
# new_state = [fringe[i].state.coord, fringe[i].state.direction]
|
|
||||||
# states.append(new_state)
|
|
||||||
# if end_position[0] == fringe[i].state.coord[0] and end_position[1] == fringe[i].state.coord[1]:
|
|
||||||
# goal_all.append(fringe[i])
|
|
||||||
#
|
|
||||||
# elem_min = goal_all[0]
|
|
||||||
# for i in range(1, len(goal_all)):
|
|
||||||
# if elem_min.priority > goal_all[i].priority:
|
|
||||||
# elem_min = goal_all[i]
|
|
||||||
# index = fringe.index(elem_min)
|
|
||||||
# fringe = fringe[:index + 1]
|
|
||||||
#
|
|
||||||
# create_action_list(states, -1)
|
|
||||||
#
|
|
||||||
# # for i in range(0, len(fringe)):
|
|
||||||
# # print('Node{} = State: {} {}, Parent: {} {} {}, Action: {}'.format(i + 1, fringe[i].state.coord, fringe[i].state.direction, fringe[i].parent[0], fringe[i].parent[1], fringe[i].parent[2], fringe[i].action))
|
|
||||||
#
|
|
||||||
# print(action_list)
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# # Start moving
|
|
||||||
# AutoMove()
|
|
||||||
|
|
||||||
|
|
||||||
|
# Add mines on the field and to arrays
|
||||||
def PutMines(mines_array):
|
def PutMines(mines_array):
|
||||||
counter = 0
|
counter = 0
|
||||||
|
|
||||||
@ -339,9 +338,18 @@ def PutMines(mines_array):
|
|||||||
if x == 0 and y == 0:
|
if x == 0 and y == 0:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
mine = Mine(x, y)
|
known = random.randint(0, 1)
|
||||||
|
power = random.randint(1, 10)
|
||||||
|
new = random.randint(0, 1)
|
||||||
|
location = CheckLocation(x, y)
|
||||||
|
stable = random.randint(0, 1)
|
||||||
|
|
||||||
|
mine = Mine(x, y, known, power, new, location, stable)
|
||||||
mines_array.append(mine)
|
mines_array.append(mine)
|
||||||
|
|
||||||
|
# Add mine to array at the right position
|
||||||
|
field.state_of_cell_array[x][y] = mine
|
||||||
|
|
||||||
field.field_state_array[x][y] = True
|
field.field_state_array[x][y] = True
|
||||||
|
|
||||||
counter += 1
|
counter += 1
|
||||||
@ -391,8 +399,8 @@ def MinesInArrays(mines_array, directory, imgs_array, bool_mines_coord):
|
|||||||
field.mines_coord.append([mines_array[i].array_x, mines_array[i].array_y])
|
field.mines_coord.append([mines_array[i].array_x, mines_array[i].array_y])
|
||||||
|
|
||||||
|
|
||||||
def DrawFlag():
|
def DrawFlag(image):
|
||||||
field.small_field_canvas.create_image(player.current_x, player.current_y, anchor=NW, image=field.flag_img)
|
field.small_field_canvas.create_image(player.current_x, player.current_y, anchor=NW, image=image)
|
||||||
|
|
||||||
|
|
||||||
# def IsItMine():
|
# def IsItMine():
|
||||||
@ -439,15 +447,14 @@ def DrawRectangle():
|
|||||||
elif field.cell_expense[i] == swamp_cell_cost:
|
elif field.cell_expense[i] == swamp_cell_cost:
|
||||||
color = "green4"
|
color = "green4"
|
||||||
if color != "None":
|
if color != "None":
|
||||||
field.small_field_canvas.create_rectangle(x, y, x + IMAGE_SIZE + 2, y + IMAGE_SIZE + 2, width=2, outline=color)
|
field.small_field_canvas.create_rectangle(x, y, x + IMAGE_SIZE + 2, y + IMAGE_SIZE + 2, width=2,
|
||||||
|
outline=color)
|
||||||
x += player.step
|
x += player.step
|
||||||
if x + IMAGE_SIZE + 2 > field.width:
|
if x + IMAGE_SIZE + 2 > field.width:
|
||||||
x = 4
|
x = 4
|
||||||
y += player.step
|
y += player.step
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def AddCostCellsToArray(amount, cost):
|
def AddCostCellsToArray(amount, cost):
|
||||||
counter = 0
|
counter = 0
|
||||||
while counter < amount:
|
while counter < amount:
|
||||||
@ -461,7 +468,9 @@ def CostingOfCells():
|
|||||||
AddCostCellsToArray(amount_of_sand_cells, sand_cell_cost)
|
AddCostCellsToArray(amount_of_sand_cells, sand_cell_cost)
|
||||||
AddCostCellsToArray(amount_of_water_cells, water_cell_cost)
|
AddCostCellsToArray(amount_of_water_cells, water_cell_cost)
|
||||||
AddCostCellsToArray(amount_of_swamp_cells, swamp_cell_cost)
|
AddCostCellsToArray(amount_of_swamp_cells, swamp_cell_cost)
|
||||||
AddCostCellsToArray(field.rows * field.columns - (amount_of_sand_cells + amount_of_water_cells + amount_of_swamp_cells), standard_cell_cost)
|
AddCostCellsToArray(
|
||||||
|
field.rows * field.columns - (amount_of_sand_cells + amount_of_water_cells + amount_of_swamp_cells),
|
||||||
|
standard_cell_cost)
|
||||||
|
|
||||||
# Draw rectangles
|
# Draw rectangles
|
||||||
DrawRectangle()
|
DrawRectangle()
|
||||||
@ -469,8 +478,9 @@ def CostingOfCells():
|
|||||||
|
|
||||||
def click_button():
|
def click_button():
|
||||||
btn.destroy()
|
btn.destroy()
|
||||||
label = Label(field.win, text="Wait...\nAI conquers the world...", fg='black', font="20")
|
global label
|
||||||
label.place(x=50, y=570)
|
label = Label(field.win, text="Wait...\nAI conquers the world...", fg='black', font="20", bg='gray')
|
||||||
|
label.place(x=10, y=560)
|
||||||
field.win.update()
|
field.win.update()
|
||||||
track = tr.genetic_algorithm(travel.points_map)
|
track = tr.genetic_algorithm(travel.points_map)
|
||||||
|
|
||||||
@ -480,6 +490,41 @@ def click_button():
|
|||||||
MouseClickEvent(track)
|
MouseClickEvent(track)
|
||||||
|
|
||||||
|
|
||||||
|
# Check if there mines near and if, mark it
|
||||||
|
def CheckForMinesNear(x, y):
|
||||||
|
if x > 0:
|
||||||
|
if field.state_of_cell_array[x - 1][y] != "None":
|
||||||
|
# Mark by chain reaction current mine
|
||||||
|
field.state_of_cell_array[x][y].chain_reaction = 1
|
||||||
|
# Mark by chain reaction mine that near
|
||||||
|
field.state_of_cell_array[x - 1][y].chain_reaction = 1
|
||||||
|
if x < 9:
|
||||||
|
if field.state_of_cell_array[x + 1][y] != "None":
|
||||||
|
# Mark by chain reaction current mine
|
||||||
|
field.state_of_cell_array[x][y].chain_reaction = 1
|
||||||
|
# Mark by chain reaction mine that near
|
||||||
|
field.state_of_cell_array[x + 1][y].chain_reaction = 1
|
||||||
|
if y > 0:
|
||||||
|
if field.state_of_cell_array[x][y - 1] != "None":
|
||||||
|
# Mark by chain reaction current mine
|
||||||
|
field.state_of_cell_array[x][y].chain_reaction = 1
|
||||||
|
# Mark by chain reaction mine that near
|
||||||
|
field.state_of_cell_array[x][y - 1].chain_reaction = 1
|
||||||
|
if y < 9:
|
||||||
|
if field.state_of_cell_array[x][y + 1] != "None":
|
||||||
|
# Mark by chain reaction current mine
|
||||||
|
field.state_of_cell_array[x][y].chain_reaction = 1
|
||||||
|
# Mark by chain reaction mine that near
|
||||||
|
field.state_of_cell_array[x][y + 1].chain_reaction = 1
|
||||||
|
|
||||||
|
|
||||||
|
def CheckForChainReaction():
|
||||||
|
for x in range(field.columns):
|
||||||
|
for y in range(field.rows):
|
||||||
|
if field.state_of_cell_array[x][y] != "None":
|
||||||
|
CheckForMinesNear(x, y)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Creating the main window of an application
|
# Creating the main window of an application
|
||||||
win_size = f'{WINDOW_X}x{WINDOW_Y}'
|
win_size = f'{WINDOW_X}x{WINDOW_Y}'
|
||||||
@ -487,6 +532,7 @@ def main():
|
|||||||
field.win.configure(bg='gray')
|
field.win.configure(bg='gray')
|
||||||
field.win.geometry(win_size)
|
field.win.geometry(win_size)
|
||||||
print(f'Amount of mines: {AMOUNT_OF_MINES}')
|
print(f'Amount of mines: {AMOUNT_OF_MINES}')
|
||||||
|
|
||||||
global btn
|
global btn
|
||||||
btn = Button(field.win,
|
btn = Button(field.win,
|
||||||
text="Search for mines", # текст кнопки
|
text="Search for mines", # текст кнопки
|
||||||
@ -498,13 +544,19 @@ def main():
|
|||||||
command=click_button
|
command=click_button
|
||||||
)
|
)
|
||||||
|
|
||||||
btn.place(x=50, y=570)
|
btn.place(x=10, y=560)
|
||||||
|
|
||||||
# Create array with mines objects
|
# Create array with mines objects
|
||||||
mines_array = []
|
mines_array = []
|
||||||
|
|
||||||
|
CostingOfCells()
|
||||||
|
|
||||||
# Put mines on coordinates
|
# Put mines on coordinates
|
||||||
PutMines(mines_array)
|
PutMines(mines_array)
|
||||||
|
|
||||||
|
CheckForChainReaction()
|
||||||
|
|
||||||
|
# Add images of mines in arrays
|
||||||
MinesInArrays(mines_array, "../../files/small_mines_images", field.small_image_array, True)
|
MinesInArrays(mines_array, "../../files/small_mines_images", field.small_image_array, True)
|
||||||
MinesInArrays(mines_array, "../../files/large_mines_images", field.large_image_array, False)
|
MinesInArrays(mines_array, "../../files/large_mines_images", field.large_image_array, False)
|
||||||
|
|
||||||
@ -514,8 +566,6 @@ def main():
|
|||||||
large_directory = "../../files/large_images"
|
large_directory = "../../files/large_images"
|
||||||
ImagesInArray(large_directory, field.large_image_array)
|
ImagesInArray(large_directory, field.large_image_array)
|
||||||
|
|
||||||
CostingOfCells()
|
|
||||||
|
|
||||||
# Add arrow image to Player class
|
# Add arrow image to Player class
|
||||||
images = []
|
images = []
|
||||||
for file in os.listdir("../../files/arrow"):
|
for file in os.listdir("../../files/arrow"):
|
||||||
@ -540,6 +590,7 @@ def main():
|
|||||||
# Binding keyboard press to function
|
# Binding keyboard press to function
|
||||||
# field.win.bind("<Key>", Action)
|
# field.win.bind("<Key>", Action)
|
||||||
# field.small_field_canvas.bind("<Button-1>", MouseClickEvent)
|
# field.small_field_canvas.bind("<Button-1>", MouseClickEvent)
|
||||||
|
|
||||||
# Starting mainloop for window
|
# Starting mainloop for window
|
||||||
field.win.mainloop()
|
field.win.mainloop()
|
||||||
|
|
||||||
|
BIN
files/decision tree/classifier.joblib
Normal file
BIN
files/decision tree/classifier.joblib
Normal file
Binary file not shown.
641
files/decision tree/database.csv
Normal file
641
files/decision tree/database.csv
Normal file
@ -0,0 +1,641 @@
|
|||||||
|
known,power,new,location,stable,chain_reaction,decision
|
||||||
|
1,1,1,0,1,1,1
|
||||||
|
1,1,1,0,1,0,2
|
||||||
|
1,1,1,0,0,1,1
|
||||||
|
1,1,1,0,0,0,2
|
||||||
|
1,1,0,0,1,1,1
|
||||||
|
1,1,0,0,1,0,2
|
||||||
|
1,1,0,0,0,1,1
|
||||||
|
1,1,0,0,0,0,2
|
||||||
|
1,1,1,1,1,1,1
|
||||||
|
1,1,1,1,1,0,2
|
||||||
|
1,1,1,1,0,1,1
|
||||||
|
1,1,1,1,0,0,2
|
||||||
|
1,1,0,1,1,1,1
|
||||||
|
1,1,0,1,1,0,2
|
||||||
|
1,1,0,1,0,1,1
|
||||||
|
1,1,0,1,0,0,2
|
||||||
|
1,1,1,2,1,1,1
|
||||||
|
1,1,1,2,1,0,2
|
||||||
|
1,1,1,2,0,1,1
|
||||||
|
1,1,1,2,0,0,2
|
||||||
|
1,1,0,2,1,1,1
|
||||||
|
1,1,0,2,1,0,2
|
||||||
|
1,1,0,2,0,1,1
|
||||||
|
1,1,0,2,0,0,2
|
||||||
|
1,1,1,3,1,1,1
|
||||||
|
1,1,1,3,1,0,2
|
||||||
|
1,1,1,3,0,1,1
|
||||||
|
1,1,1,3,0,0,2
|
||||||
|
1,1,0,3,1,1,1
|
||||||
|
1,1,0,3,1,0,2
|
||||||
|
1,1,0,3,0,1,1
|
||||||
|
1,1,0,3,0,0,2
|
||||||
|
1,2,1,0,1,1,1
|
||||||
|
1,2,1,0,1,0,2
|
||||||
|
1,2,1,0,0,1,1
|
||||||
|
1,2,1,0,0,0,2
|
||||||
|
1,2,0,0,1,1,1
|
||||||
|
1,2,0,0,1,0,2
|
||||||
|
1,2,0,0,0,1,1
|
||||||
|
1,2,0,0,0,0,2
|
||||||
|
1,2,1,1,1,1,1
|
||||||
|
1,2,1,1,1,0,2
|
||||||
|
1,2,1,1,0,1,1
|
||||||
|
1,2,1,1,0,0,2
|
||||||
|
1,2,0,1,1,1,1
|
||||||
|
1,2,0,1,1,0,2
|
||||||
|
1,2,0,1,0,1,1
|
||||||
|
1,2,0,1,0,0,2
|
||||||
|
1,2,1,2,1,1,1
|
||||||
|
1,2,1,2,1,0,2
|
||||||
|
1,2,1,2,0,1,1
|
||||||
|
1,2,1,2,0,0,2
|
||||||
|
1,2,0,2,1,1,1
|
||||||
|
1,2,0,2,1,0,2
|
||||||
|
1,2,0,2,0,1,1
|
||||||
|
1,2,0,2,0,0,2
|
||||||
|
1,2,1,3,1,1,1
|
||||||
|
1,2,1,3,1,0,2
|
||||||
|
1,2,1,3,0,1,1
|
||||||
|
1,2,1,3,0,0,2
|
||||||
|
1,2,0,3,1,1,1
|
||||||
|
1,2,0,3,1,0,2
|
||||||
|
1,2,0,3,0,1,1
|
||||||
|
1,2,0,3,0,0,2
|
||||||
|
1,3,1,0,1,1,1
|
||||||
|
1,3,1,0,1,0,2
|
||||||
|
1,3,1,0,0,1,1
|
||||||
|
1,3,1,0,0,0,2
|
||||||
|
1,3,0,0,1,1,1
|
||||||
|
1,3,0,0,1,0,2
|
||||||
|
1,3,0,0,0,1,1
|
||||||
|
1,3,0,0,0,0,2
|
||||||
|
1,3,1,1,1,1,1
|
||||||
|
1,3,1,1,1,0,2
|
||||||
|
1,3,1,1,0,1,1
|
||||||
|
1,3,1,1,0,0,2
|
||||||
|
1,3,0,1,1,1,1
|
||||||
|
1,3,0,1,1,0,2
|
||||||
|
1,3,0,1,0,1,1
|
||||||
|
1,3,0,1,0,0,2
|
||||||
|
1,3,1,2,1,1,1
|
||||||
|
1,3,1,2,1,0,2
|
||||||
|
1,3,1,2,0,1,1
|
||||||
|
1,3,1,2,0,0,2
|
||||||
|
1,3,0,2,1,1,1
|
||||||
|
1,3,0,2,1,0,2
|
||||||
|
1,3,0,2,0,1,1
|
||||||
|
1,3,0,2,0,0,2
|
||||||
|
1,3,1,3,1,1,1
|
||||||
|
1,3,1,3,1,0,2
|
||||||
|
1,3,1,3,0,1,1
|
||||||
|
1,3,1,3,0,0,2
|
||||||
|
1,3,0,3,1,1,1
|
||||||
|
1,3,0,3,1,0,2
|
||||||
|
1,3,0,3,0,1,1
|
||||||
|
1,3,0,3,0,0,2
|
||||||
|
1,4,1,0,1,1,0
|
||||||
|
1,4,1,0,1,0,0
|
||||||
|
1,4,1,0,0,1,1
|
||||||
|
1,4,1,0,0,0,2
|
||||||
|
1,4,0,0,1,1,1
|
||||||
|
1,4,0,0,1,0,2
|
||||||
|
1,4,0,0,0,1,1
|
||||||
|
1,4,0,0,0,0,2
|
||||||
|
1,4,1,1,1,1,3
|
||||||
|
1,4,1,1,1,0,3
|
||||||
|
1,4,1,1,0,1,1
|
||||||
|
1,4,1,1,0,0,2
|
||||||
|
1,4,0,1,1,1,1
|
||||||
|
1,4,0,1,1,0,2
|
||||||
|
1,4,0,1,0,1,1
|
||||||
|
1,4,0,1,0,0,2
|
||||||
|
1,4,1,2,1,1,3
|
||||||
|
1,4,1,2,1,0,3
|
||||||
|
1,4,1,2,0,1,1
|
||||||
|
1,4,1,2,0,0,2
|
||||||
|
1,4,0,2,1,1,1
|
||||||
|
1,4,0,2,1,0,2
|
||||||
|
1,4,0,2,0,1,1
|
||||||
|
1,4,0,2,0,0,2
|
||||||
|
1,4,1,3,1,1,1
|
||||||
|
1,4,1,3,1,0,2
|
||||||
|
1,4,1,3,0,1,1
|
||||||
|
1,4,1,3,0,0,2
|
||||||
|
1,4,0,3,1,1,1
|
||||||
|
1,4,0,3,1,0,2
|
||||||
|
1,4,0,3,0,1,1
|
||||||
|
1,4,0,3,0,0,2
|
||||||
|
1,5,1,0,1,1,0
|
||||||
|
1,5,1,0,1,0,0
|
||||||
|
1,5,1,0,0,1,1
|
||||||
|
1,5,1,0,0,0,2
|
||||||
|
1,5,0,0,1,1,1
|
||||||
|
1,5,0,0,1,0,2
|
||||||
|
1,5,0,0,0,1,1
|
||||||
|
1,5,0,0,0,0,2
|
||||||
|
1,5,1,1,1,1,3
|
||||||
|
1,5,1,1,1,0,3
|
||||||
|
1,5,1,1,0,1,1
|
||||||
|
1,5,1,1,0,0,2
|
||||||
|
1,5,0,1,1,1,1
|
||||||
|
1,5,0,1,1,0,2
|
||||||
|
1,5,0,1,0,1,1
|
||||||
|
1,5,0,1,0,0,2
|
||||||
|
1,5,1,2,1,1,3
|
||||||
|
1,5,1,2,1,0,3
|
||||||
|
1,5,1,2,0,1,1
|
||||||
|
1,5,1,2,0,0,2
|
||||||
|
1,5,0,2,1,1,1
|
||||||
|
1,5,0,2,1,0,2
|
||||||
|
1,5,0,2,0,1,1
|
||||||
|
1,5,0,2,0,0,2
|
||||||
|
1,5,1,3,1,1,1
|
||||||
|
1,5,1,3,1,0,2
|
||||||
|
1,5,1,3,0,1,1
|
||||||
|
1,5,1,3,0,0,2
|
||||||
|
1,5,0,3,1,1,1
|
||||||
|
1,5,0,3,1,0,2
|
||||||
|
1,5,0,3,0,1,1
|
||||||
|
1,5,0,3,0,0,2
|
||||||
|
1,6,1,0,1,1,0
|
||||||
|
1,6,1,0,1,0,0
|
||||||
|
1,6,1,0,0,1,1
|
||||||
|
1,6,1,0,0,0,2
|
||||||
|
1,6,0,0,1,1,1
|
||||||
|
1,6,0,0,1,0,2
|
||||||
|
1,6,0,0,0,1,1
|
||||||
|
1,6,0,0,0,0,2
|
||||||
|
1,6,1,1,1,1,3
|
||||||
|
1,6,1,1,1,0,3
|
||||||
|
1,6,1,1,0,1,1
|
||||||
|
1,6,1,1,0,0,2
|
||||||
|
1,6,0,1,1,1,1
|
||||||
|
1,6,0,1,1,0,2
|
||||||
|
1,6,0,1,0,1,1
|
||||||
|
1,6,0,1,0,0,2
|
||||||
|
1,6,1,2,1,1,3
|
||||||
|
1,6,1,2,1,0,3
|
||||||
|
1,6,1,2,0,1,1
|
||||||
|
1,6,1,2,0,0,2
|
||||||
|
1,6,0,2,1,1,1
|
||||||
|
1,6,0,2,1,0,2
|
||||||
|
1,6,0,2,0,1,1
|
||||||
|
1,6,0,2,0,0,2
|
||||||
|
1,6,1,3,1,1,1
|
||||||
|
1,6,1,3,1,0,2
|
||||||
|
1,6,1,3,0,1,1
|
||||||
|
1,6,1,3,0,0,2
|
||||||
|
1,6,0,3,1,1,1
|
||||||
|
1,6,0,3,1,0,2
|
||||||
|
1,6,0,3,0,1,1
|
||||||
|
1,6,0,3,0,0,2
|
||||||
|
1,7,1,0,1,1,0
|
||||||
|
1,7,1,0,1,0,0
|
||||||
|
1,7,1,0,0,1,1
|
||||||
|
1,7,1,0,0,0,2
|
||||||
|
1,7,0,0,1,1,1
|
||||||
|
1,7,0,0,1,0,2
|
||||||
|
1,7,0,0,0,1,1
|
||||||
|
1,7,0,0,0,0,2
|
||||||
|
1,7,1,1,1,1,3
|
||||||
|
1,7,1,1,1,0,3
|
||||||
|
1,7,1,1,0,1,1
|
||||||
|
1,7,1,1,0,0,2
|
||||||
|
1,7,0,1,1,1,1
|
||||||
|
1,7,0,1,1,0,2
|
||||||
|
1,7,0,1,0,1,1
|
||||||
|
1,7,0,1,0,0,2
|
||||||
|
1,7,1,2,1,1,3
|
||||||
|
1,7,1,2,1,0,3
|
||||||
|
1,7,1,2,0,1,1
|
||||||
|
1,7,1,2,0,0,2
|
||||||
|
1,7,0,2,1,1,1
|
||||||
|
1,7,0,2,1,0,2
|
||||||
|
1,7,0,2,0,1,1
|
||||||
|
1,7,0,2,0,0,2
|
||||||
|
1,7,1,3,1,1,1
|
||||||
|
1,7,1,3,1,0,2
|
||||||
|
1,7,1,3,0,1,1
|
||||||
|
1,7,1,3,0,0,2
|
||||||
|
1,7,0,3,1,1,1
|
||||||
|
1,7,0,3,1,0,2
|
||||||
|
1,7,0,3,0,1,1
|
||||||
|
1,7,0,3,0,0,2
|
||||||
|
1,8,1,0,1,1,0
|
||||||
|
1,8,1,0,1,0,0
|
||||||
|
1,8,1,0,0,1,0
|
||||||
|
1,8,1,0,0,0,0
|
||||||
|
1,8,0,0,1,1,0
|
||||||
|
1,8,0,0,1,0,0
|
||||||
|
1,8,0,0,0,1,0
|
||||||
|
1,8,0,0,0,0,0
|
||||||
|
1,8,1,1,1,1,0
|
||||||
|
1,8,1,1,1,0,0
|
||||||
|
1,8,1,1,0,1,0
|
||||||
|
1,8,1,1,0,0,0
|
||||||
|
1,8,0,1,1,1,0
|
||||||
|
1,8,0,1,1,0,0
|
||||||
|
1,8,0,1,0,1,0
|
||||||
|
1,8,0,1,0,0,0
|
||||||
|
1,8,1,2,1,1,0
|
||||||
|
1,8,1,2,1,0,0
|
||||||
|
1,8,1,2,0,1,0
|
||||||
|
1,8,1,2,0,0,0
|
||||||
|
1,8,0,2,1,1,0
|
||||||
|
1,8,0,2,1,0,0
|
||||||
|
1,8,0,2,0,1,0
|
||||||
|
1,8,0,2,0,0,0
|
||||||
|
1,8,1,3,1,1,0
|
||||||
|
1,8,1,3,1,0,0
|
||||||
|
1,8,1,3,0,1,0
|
||||||
|
1,8,1,3,0,0,0
|
||||||
|
1,8,0,3,1,1,0
|
||||||
|
1,8,0,3,1,0,0
|
||||||
|
1,8,0,3,0,1,0
|
||||||
|
1,8,0,3,0,0,0
|
||||||
|
1,9,1,0,1,1,0
|
||||||
|
1,9,1,0,1,0,0
|
||||||
|
1,9,1,0,0,1,0
|
||||||
|
1,9,1,0,0,0,0
|
||||||
|
1,9,0,0,1,1,0
|
||||||
|
1,9,0,0,1,0,0
|
||||||
|
1,9,0,0,0,1,0
|
||||||
|
1,9,0,0,0,0,0
|
||||||
|
1,9,1,1,1,1,0
|
||||||
|
1,9,1,1,1,0,0
|
||||||
|
1,9,1,1,0,1,0
|
||||||
|
1,9,1,1,0,0,0
|
||||||
|
1,9,0,1,1,1,0
|
||||||
|
1,9,0,1,1,0,0
|
||||||
|
1,9,0,1,0,1,0
|
||||||
|
1,9,0,1,0,0,0
|
||||||
|
1,9,1,2,1,1,0
|
||||||
|
1,9,1,2,1,0,0
|
||||||
|
1,9,1,2,0,1,0
|
||||||
|
1,9,1,2,0,0,0
|
||||||
|
1,9,0,2,1,1,0
|
||||||
|
1,9,0,2,1,0,0
|
||||||
|
1,9,0,2,0,1,0
|
||||||
|
1,9,0,2,0,0,0
|
||||||
|
1,9,1,3,1,1,0
|
||||||
|
1,9,1,3,1,0,0
|
||||||
|
1,9,1,3,0,1,0
|
||||||
|
1,9,1,3,0,0,0
|
||||||
|
1,9,0,3,1,1,0
|
||||||
|
1,9,0,3,1,0,0
|
||||||
|
1,9,0,3,0,1,0
|
||||||
|
1,9,0,3,0,0,0
|
||||||
|
1,10,1,0,1,1,0
|
||||||
|
1,10,1,0,1,0,0
|
||||||
|
1,10,1,0,0,1,0
|
||||||
|
1,10,1,0,0,0,0
|
||||||
|
1,10,0,0,1,1,0
|
||||||
|
1,10,0,0,1,0,0
|
||||||
|
1,10,0,0,0,1,0
|
||||||
|
1,10,0,0,0,0,0
|
||||||
|
1,10,1,1,1,1,0
|
||||||
|
1,10,1,1,1,0,0
|
||||||
|
1,10,1,1,0,1,0
|
||||||
|
1,10,1,1,0,0,0
|
||||||
|
1,10,0,1,1,1,0
|
||||||
|
1,10,0,1,1,0,0
|
||||||
|
1,10,0,1,0,1,0
|
||||||
|
1,10,0,1,0,0,0
|
||||||
|
1,10,1,2,1,1,0
|
||||||
|
1,10,1,2,1,0,0
|
||||||
|
1,10,1,2,0,1,0
|
||||||
|
1,10,1,2,0,0,0
|
||||||
|
1,10,0,2,1,1,0
|
||||||
|
1,10,0,2,1,0,0
|
||||||
|
1,10,0,2,0,1,0
|
||||||
|
1,10,0,2,0,0,0
|
||||||
|
1,10,1,3,1,1,0
|
||||||
|
1,10,1,3,1,0,0
|
||||||
|
1,10,1,3,0,1,0
|
||||||
|
1,10,1,3,0,0,0
|
||||||
|
1,10,0,3,1,1,0
|
||||||
|
1,10,0,3,1,0,0
|
||||||
|
1,10,0,3,0,1,0
|
||||||
|
1,10,0,3,0,0,0
|
||||||
|
0,1,1,0,1,1,1
|
||||||
|
0,1,1,0,1,0,1
|
||||||
|
0,1,1,0,0,1,1
|
||||||
|
0,1,1,0,0,0,1
|
||||||
|
0,1,0,0,1,1,1
|
||||||
|
0,1,0,0,1,0,1
|
||||||
|
0,1,0,0,0,1,1
|
||||||
|
0,1,0,0,0,0,1
|
||||||
|
0,1,1,1,1,1,1
|
||||||
|
0,1,1,1,1,0,1
|
||||||
|
0,1,1,1,0,1,1
|
||||||
|
0,1,1,1,0,0,1
|
||||||
|
0,1,0,1,1,1,1
|
||||||
|
0,1,0,1,1,0,1
|
||||||
|
0,1,0,1,0,1,1
|
||||||
|
0,1,0,1,0,0,1
|
||||||
|
0,1,1,2,1,1,1
|
||||||
|
0,1,1,2,1,0,1
|
||||||
|
0,1,1,2,0,1,1
|
||||||
|
0,1,1,2,0,0,1
|
||||||
|
0,1,0,2,1,1,1
|
||||||
|
0,1,0,2,1,0,1
|
||||||
|
0,1,0,2,0,1,1
|
||||||
|
0,1,0,2,0,0,1
|
||||||
|
0,1,1,3,1,1,1
|
||||||
|
0,1,1,3,1,0,1
|
||||||
|
0,1,1,3,0,1,1
|
||||||
|
0,1,1,3,0,0,1
|
||||||
|
0,1,0,3,1,1,1
|
||||||
|
0,1,0,3,1,0,1
|
||||||
|
0,1,0,3,0,1,1
|
||||||
|
0,1,0,3,0,0,1
|
||||||
|
0,2,1,0,1,1,1
|
||||||
|
0,2,1,0,1,0,1
|
||||||
|
0,2,1,0,0,1,1
|
||||||
|
0,2,1,0,0,0,1
|
||||||
|
0,2,0,0,1,1,1
|
||||||
|
0,2,0,0,1,0,1
|
||||||
|
0,2,0,0,0,1,1
|
||||||
|
0,2,0,0,0,0,1
|
||||||
|
0,2,1,1,1,1,1
|
||||||
|
0,2,1,1,1,0,1
|
||||||
|
0,2,1,1,0,1,1
|
||||||
|
0,2,1,1,0,0,1
|
||||||
|
0,2,0,1,1,1,1
|
||||||
|
0,2,0,1,1,0,1
|
||||||
|
0,2,0,1,0,1,1
|
||||||
|
0,2,0,1,0,0,1
|
||||||
|
0,2,1,2,1,1,1
|
||||||
|
0,2,1,2,1,0,1
|
||||||
|
0,2,1,2,0,1,1
|
||||||
|
0,2,1,2,0,0,1
|
||||||
|
0,2,0,2,1,1,1
|
||||||
|
0,2,0,2,1,0,1
|
||||||
|
0,2,0,2,0,1,1
|
||||||
|
0,2,0,2,0,0,1
|
||||||
|
0,2,1,3,1,1,1
|
||||||
|
0,2,1,3,1,0,1
|
||||||
|
0,2,1,3,0,1,1
|
||||||
|
0,2,1,3,0,0,1
|
||||||
|
0,2,0,3,1,1,1
|
||||||
|
0,2,0,3,1,0,1
|
||||||
|
0,2,0,3,0,1,1
|
||||||
|
0,2,0,3,0,0,1
|
||||||
|
0,3,1,0,1,1,1
|
||||||
|
0,3,1,0,1,0,1
|
||||||
|
0,3,1,0,0,1,1
|
||||||
|
0,3,1,0,0,0,1
|
||||||
|
0,3,0,0,1,1,1
|
||||||
|
0,3,0,0,1,0,1
|
||||||
|
0,3,0,0,0,1,1
|
||||||
|
0,3,0,0,0,0,1
|
||||||
|
0,3,1,1,1,1,1
|
||||||
|
0,3,1,1,1,0,1
|
||||||
|
0,3,1,1,0,1,1
|
||||||
|
0,3,1,1,0,0,1
|
||||||
|
0,3,0,1,1,1,1
|
||||||
|
0,3,0,1,1,0,1
|
||||||
|
0,3,0,1,0,1,1
|
||||||
|
0,3,0,1,0,0,1
|
||||||
|
0,3,1,2,1,1,1
|
||||||
|
0,3,1,2,1,0,1
|
||||||
|
0,3,1,2,0,1,1
|
||||||
|
0,3,1,2,0,0,1
|
||||||
|
0,3,0,2,1,1,1
|
||||||
|
0,3,0,2,1,0,1
|
||||||
|
0,3,0,2,0,1,1
|
||||||
|
0,3,0,2,0,0,1
|
||||||
|
0,3,1,3,1,1,1
|
||||||
|
0,3,1,3,1,0,1
|
||||||
|
0,3,1,3,0,1,1
|
||||||
|
0,3,1,3,0,0,1
|
||||||
|
0,3,0,3,1,1,1
|
||||||
|
0,3,0,3,1,0,1
|
||||||
|
0,3,0,3,0,1,1
|
||||||
|
0,3,0,3,0,0,1
|
||||||
|
0,4,1,0,1,1,1
|
||||||
|
0,4,1,0,1,0,1
|
||||||
|
0,4,1,0,0,1,1
|
||||||
|
0,4,1,0,0,0,1
|
||||||
|
0,4,0,0,1,1,1
|
||||||
|
0,4,0,0,1,0,1
|
||||||
|
0,4,0,0,0,1,1
|
||||||
|
0,4,0,0,0,0,1
|
||||||
|
0,4,1,1,1,1,1
|
||||||
|
0,4,1,1,1,0,1
|
||||||
|
0,4,1,1,0,1,1
|
||||||
|
0,4,1,1,0,0,1
|
||||||
|
0,4,0,1,1,1,1
|
||||||
|
0,4,0,1,1,0,1
|
||||||
|
0,4,0,1,0,1,1
|
||||||
|
0,4,0,1,0,0,1
|
||||||
|
0,4,1,2,1,1,1
|
||||||
|
0,4,1,2,1,0,1
|
||||||
|
0,4,1,2,0,1,1
|
||||||
|
0,4,1,2,0,0,1
|
||||||
|
0,4,0,2,1,1,1
|
||||||
|
0,4,0,2,1,0,1
|
||||||
|
0,4,0,2,0,1,1
|
||||||
|
0,4,0,2,0,0,1
|
||||||
|
0,4,1,3,1,1,1
|
||||||
|
0,4,1,3,1,0,1
|
||||||
|
0,4,1,3,0,1,1
|
||||||
|
0,4,1,3,0,0,1
|
||||||
|
0,4,0,3,1,1,1
|
||||||
|
0,4,0,3,1,0,1
|
||||||
|
0,4,0,3,0,1,1
|
||||||
|
0,4,0,3,0,0,1
|
||||||
|
0,5,1,0,1,1,1
|
||||||
|
0,5,1,0,1,0,1
|
||||||
|
0,5,1,0,0,1,1
|
||||||
|
0,5,1,0,0,0,1
|
||||||
|
0,5,0,0,1,1,1
|
||||||
|
0,5,0,0,1,0,1
|
||||||
|
0,5,0,0,0,1,1
|
||||||
|
0,5,0,0,0,0,1
|
||||||
|
0,5,1,1,1,1,1
|
||||||
|
0,5,1,1,1,0,1
|
||||||
|
0,5,1,1,0,1,1
|
||||||
|
0,5,1,1,0,0,1
|
||||||
|
0,5,0,1,1,1,1
|
||||||
|
0,5,0,1,1,0,1
|
||||||
|
0,5,0,1,0,1,1
|
||||||
|
0,5,0,1,0,0,1
|
||||||
|
0,5,1,2,1,1,1
|
||||||
|
0,5,1,2,1,0,1
|
||||||
|
0,5,1,2,0,1,1
|
||||||
|
0,5,1,2,0,0,1
|
||||||
|
0,5,0,2,1,1,1
|
||||||
|
0,5,0,2,1,0,1
|
||||||
|
0,5,0,2,0,1,1
|
||||||
|
0,5,0,2,0,0,1
|
||||||
|
0,5,1,3,1,1,1
|
||||||
|
0,5,1,3,1,0,1
|
||||||
|
0,5,1,3,0,1,1
|
||||||
|
0,5,1,3,0,0,1
|
||||||
|
0,5,0,3,1,1,1
|
||||||
|
0,5,0,3,1,0,1
|
||||||
|
0,5,0,3,0,1,1
|
||||||
|
0,5,0,3,0,0,1
|
||||||
|
0,6,1,0,1,1,1
|
||||||
|
0,6,1,0,1,0,1
|
||||||
|
0,6,1,0,0,1,1
|
||||||
|
0,6,1,0,0,0,1
|
||||||
|
0,6,0,0,1,1,1
|
||||||
|
0,6,0,0,1,0,1
|
||||||
|
0,6,0,0,0,1,1
|
||||||
|
0,6,0,0,0,0,1
|
||||||
|
0,6,1,1,1,1,1
|
||||||
|
0,6,1,1,1,0,1
|
||||||
|
0,6,1,1,0,1,1
|
||||||
|
0,6,1,1,0,0,1
|
||||||
|
0,6,0,1,1,1,1
|
||||||
|
0,6,0,1,1,0,1
|
||||||
|
0,6,0,1,0,1,1
|
||||||
|
0,6,0,1,0,0,1
|
||||||
|
0,6,1,2,1,1,1
|
||||||
|
0,6,1,2,1,0,1
|
||||||
|
0,6,1,2,0,1,1
|
||||||
|
0,6,1,2,0,0,1
|
||||||
|
0,6,0,2,1,1,1
|
||||||
|
0,6,0,2,1,0,1
|
||||||
|
0,6,0,2,0,1,1
|
||||||
|
0,6,0,2,0,0,1
|
||||||
|
0,6,1,3,1,1,1
|
||||||
|
0,6,1,3,1,0,1
|
||||||
|
0,6,1,3,0,1,1
|
||||||
|
0,6,1,3,0,0,1
|
||||||
|
0,6,0,3,1,1,1
|
||||||
|
0,6,0,3,1,0,1
|
||||||
|
0,6,0,3,0,1,1
|
||||||
|
0,6,0,3,0,0,1
|
||||||
|
0,7,1,0,1,1,1
|
||||||
|
0,7,1,0,1,0,1
|
||||||
|
0,7,1,0,0,1,1
|
||||||
|
0,7,1,0,0,0,1
|
||||||
|
0,7,0,0,1,1,1
|
||||||
|
0,7,0,0,1,0,1
|
||||||
|
0,7,0,0,0,1,1
|
||||||
|
0,7,0,0,0,0,1
|
||||||
|
0,7,1,1,1,1,1
|
||||||
|
0,7,1,1,1,0,1
|
||||||
|
0,7,1,1,0,1,1
|
||||||
|
0,7,1,1,0,0,1
|
||||||
|
0,7,0,1,1,1,1
|
||||||
|
0,7,0,1,1,0,1
|
||||||
|
0,7,0,1,0,1,1
|
||||||
|
0,7,0,1,0,0,1
|
||||||
|
0,7,1,2,1,1,1
|
||||||
|
0,7,1,2,1,0,1
|
||||||
|
0,7,1,2,0,1,1
|
||||||
|
0,7,1,2,0,0,1
|
||||||
|
0,7,0,2,1,1,1
|
||||||
|
0,7,0,2,1,0,1
|
||||||
|
0,7,0,2,0,1,1
|
||||||
|
0,7,0,2,0,0,1
|
||||||
|
0,7,1,3,1,1,1
|
||||||
|
0,7,1,3,1,0,1
|
||||||
|
0,7,1,3,0,1,1
|
||||||
|
0,7,1,3,0,0,1
|
||||||
|
0,7,0,3,1,1,1
|
||||||
|
0,7,0,3,1,0,1
|
||||||
|
0,7,0,3,0,1,1
|
||||||
|
0,7,0,3,0,0,1
|
||||||
|
0,8,1,0,1,1,1
|
||||||
|
0,8,1,0,1,0,1
|
||||||
|
0,8,1,0,0,1,1
|
||||||
|
0,8,1,0,0,0,1
|
||||||
|
0,8,0,0,1,1,1
|
||||||
|
0,8,0,0,1,0,1
|
||||||
|
0,8,0,0,0,1,1
|
||||||
|
0,8,0,0,0,0,1
|
||||||
|
0,8,1,1,1,1,1
|
||||||
|
0,8,1,1,1,0,1
|
||||||
|
0,8,1,1,0,1,1
|
||||||
|
0,8,1,1,0,0,1
|
||||||
|
0,8,0,1,1,1,1
|
||||||
|
0,8,0,1,1,0,1
|
||||||
|
0,8,0,1,0,1,1
|
||||||
|
0,8,0,1,0,0,1
|
||||||
|
0,8,1,2,1,1,1
|
||||||
|
0,8,1,2,1,0,1
|
||||||
|
0,8,1,2,0,1,1
|
||||||
|
0,8,1,2,0,0,1
|
||||||
|
0,8,0,2,1,1,1
|
||||||
|
0,8,0,2,1,0,1
|
||||||
|
0,8,0,2,0,1,1
|
||||||
|
0,8,0,2,0,0,1
|
||||||
|
0,8,1,3,1,1,1
|
||||||
|
0,8,1,3,1,0,1
|
||||||
|
0,8,1,3,0,1,1
|
||||||
|
0,8,1,3,0,0,1
|
||||||
|
0,8,0,3,1,1,1
|
||||||
|
0,8,0,3,1,0,1
|
||||||
|
0,8,0,3,0,1,1
|
||||||
|
0,8,0,3,0,0,1
|
||||||
|
0,9,1,0,1,1,1
|
||||||
|
0,9,1,0,1,0,1
|
||||||
|
0,9,1,0,0,1,1
|
||||||
|
0,9,1,0,0,0,1
|
||||||
|
0,9,0,0,1,1,1
|
||||||
|
0,9,0,0,1,0,1
|
||||||
|
0,9,0,0,0,1,1
|
||||||
|
0,9,0,0,0,0,1
|
||||||
|
0,9,1,1,1,1,1
|
||||||
|
0,9,1,1,1,0,1
|
||||||
|
0,9,1,1,0,1,1
|
||||||
|
0,9,1,1,0,0,1
|
||||||
|
0,9,0,1,1,1,1
|
||||||
|
0,9,0,1,1,0,1
|
||||||
|
0,9,0,1,0,1,1
|
||||||
|
0,9,0,1,0,0,1
|
||||||
|
0,9,1,2,1,1,1
|
||||||
|
0,9,1,2,1,0,1
|
||||||
|
0,9,1,2,0,1,1
|
||||||
|
0,9,1,2,0,0,1
|
||||||
|
0,9,0,2,1,1,1
|
||||||
|
0,9,0,2,1,0,1
|
||||||
|
0,9,0,2,0,1,1
|
||||||
|
0,9,0,2,0,0,1
|
||||||
|
0,9,1,3,1,1,1
|
||||||
|
0,9,1,3,1,0,1
|
||||||
|
0,9,1,3,0,1,1
|
||||||
|
0,9,1,3,0,0,1
|
||||||
|
0,9,0,3,1,1,1
|
||||||
|
0,9,0,3,1,0,1
|
||||||
|
0,9,0,3,0,1,1
|
||||||
|
0,9,0,3,0,0,1
|
||||||
|
0,10,1,0,1,1,1
|
||||||
|
0,10,1,0,1,0,1
|
||||||
|
0,10,1,0,0,1,1
|
||||||
|
0,10,1,0,0,0,1
|
||||||
|
0,10,0,0,1,1,1
|
||||||
|
0,10,0,0,1,0,1
|
||||||
|
0,10,0,0,0,1,1
|
||||||
|
0,10,0,0,0,0,1
|
||||||
|
0,10,1,1,1,1,1
|
||||||
|
0,10,1,1,1,0,1
|
||||||
|
0,10,1,1,0,1,1
|
||||||
|
0,10,1,1,0,0,1
|
||||||
|
0,10,0,1,1,1,1
|
||||||
|
0,10,0,1,1,0,1
|
||||||
|
0,10,0,1,0,1,1
|
||||||
|
0,10,0,1,0,0,1
|
||||||
|
0,10,1,2,1,1,1
|
||||||
|
0,10,1,2,1,0,1
|
||||||
|
0,10,1,2,0,1,1
|
||||||
|
0,10,1,2,0,0,1
|
||||||
|
0,10,0,2,1,1,1
|
||||||
|
0,10,0,2,1,0,1
|
||||||
|
0,10,0,2,0,1,1
|
||||||
|
0,10,0,2,0,0,1
|
||||||
|
0,10,1,3,1,1,1
|
||||||
|
0,10,1,3,1,0,1
|
||||||
|
0,10,1,3,0,1,1
|
||||||
|
0,10,1,3,0,0,1
|
||||||
|
0,10,0,3,1,1,1
|
||||||
|
0,10,0,3,1,0,1
|
||||||
|
0,10,0,3,0,1,1
|
||||||
|
0,10,0,3,0,0,1
|
|
BIN
files/flag/FlagBlue.png
Normal file
BIN
files/flag/FlagBlue.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 395 B |
BIN
files/flag/FlagGreen.png
Normal file
BIN
files/flag/FlagGreen.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 397 B |
BIN
files/flag/FlagRed.png
Normal file
BIN
files/flag/FlagRed.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 388 B |
BIN
files/flag/FlagYellow.png
Normal file
BIN
files/flag/FlagYellow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 439 B |
Binary file not shown.
Before Width: | Height: | Size: 372 B |
@ -14,7 +14,7 @@ MAX_AMOUNT_OF_MINES = 11
|
|||||||
AMOUNT_OF_MINES = random.randint(MIN_AMOUNT_OF_MINES, MAX_AMOUNT_OF_MINES)
|
AMOUNT_OF_MINES = random.randint(MIN_AMOUNT_OF_MINES, MAX_AMOUNT_OF_MINES)
|
||||||
|
|
||||||
DELAY_TIME = 0.2
|
DELAY_TIME = 0.2
|
||||||
SLEEP_AFTER_CHECK_MINE = 1
|
SLEEP_AFTER_CHECK_MINE = 2
|
||||||
|
|
||||||
STEP = IMAGE_SIZE + 5
|
STEP = IMAGE_SIZE + 5
|
||||||
|
|
||||||
@ -36,3 +36,6 @@ NUMBER_OF_INDIVIDUALS_FOR_DUEL = 4
|
|||||||
NUMBER_OF_POINTS_PERMUTATION = 10
|
NUMBER_OF_POINTS_PERMUTATION = 10
|
||||||
PERCENT_OF_MUTATION = 0.01
|
PERCENT_OF_MUTATION = 0.01
|
||||||
PERCENT_OF_OUTGOING_INDIVIDUALS = 0.03
|
PERCENT_OF_OUTGOING_INDIVIDUALS = 0.03
|
||||||
|
|
||||||
|
|
||||||
|
label_text = ""
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user