From acafb05ae0d1422cad6d220fb1366c563691ccb9 Mon Sep 17 00:00:00 2001 From: Kacper Date: Thu, 15 Jun 2023 14:03:24 +0200 Subject: [PATCH] small fix + pygad install --- NN/Generator.py | 2 - NN/trainer.py | 11 +- astar.py | 32 ++--- bfs.py | 18 +-- board.py | 10 +- cart.py | 2 - classes.py | 15 +- decisionTree/generator.py | 4 +- decisionTree/treemaker.py | 10 +- definitions.py | 4 +- img/player.png | Bin 16754 -> 2988 bytes img/tree.png | Bin 2079 -> 3959 bytes main.py | 295 ++++++++++---------------------------- screen.py | 2 +- 14 files changed, 120 insertions(+), 285 deletions(-) diff --git a/NN/Generator.py b/NN/Generator.py index cc54c28..7e28fe6 100644 --- a/NN/Generator.py +++ b/NN/Generator.py @@ -15,7 +15,6 @@ b = [Image.open("b1.png").convert('RGBA'), Image.open("b2.png").convert('RGBA'), def generate(water, fertilizer, plantf): - new_im = None if water == 1: new_im = Image.new('RGB', (100, 100), (160 + random.randint(-10, 10), 80 + random.randint(-10, 10), 40 + random.randint(-10, 10))) @@ -81,4 +80,3 @@ for x in range(0, 1000): generate(0, 1, random.randint(0, 2)).save('datasets/01/' + str(x) + '.png') for x in range(0, 1000): generate(1, 1, random.randint(0, 2)).save('datasets/11/' + str(x) + '.png') - diff --git a/NN/trainer.py b/NN/trainer.py index f27083b..845ab43 100644 --- a/NN/trainer.py +++ b/NN/trainer.py @@ -2,13 +2,14 @@ import pathlib import random import torch -from PIL.Image import Image from torch import nn from torch.utils.data import DataLoader from torchvision import datasets, transforms from torchvision.transforms import Lambda -device = torch.device('cuda') + +device = torch.device('cpu') + def train(model, dataset, n_iter=100, batch_size=2560000): optimizer = torch.optim.SGD(model.parameters(), lr=0.01) @@ -40,8 +41,8 @@ train_data = datasets.ImageFolder(root="./datasets", transform=data_transform, target_transform=None) -model1=nn.Sequential(nn.Linear(30000, 10000),nn.ReLU(),nn.Linear(10000,10000),nn.ReLU(),nn.Linear(10000,10000),nn.Linear(10000,4),nn.LogSoftmax(dim=-1)).to(device) +model1 = nn.Sequential(nn.Linear(30000, 10000), nn.ReLU(), nn.Linear(10000, 10000), nn.ReLU(), nn.Linear(10000, 0000), nn.Linear(10000, 4), nn.LogSoftmax(dim=-1)).to(device) model1.load_state_dict(torch.load("./trained")) -train(model1,train_data) +train(model1, train_data) -torch.save(model1.state_dict(), "./trained") \ No newline at end of file +torch.save(model1.state_dict(), "./trained") diff --git a/astar.py b/astar.py index 655b25a..41136a2 100644 --- a/astar.py +++ b/astar.py @@ -1,7 +1,6 @@ from operator import itemgetter import cart import copy -from classes import Field class Istate: @@ -68,23 +67,23 @@ class Node: self.y = y -def fieldCost(T,node): +def fieldCost(T, node): c = 0 if T[node.x-1][node.y-1].plantType == 1: - c =2 + c = 2 elif T[node.x-1][node.y-1].plantType == 2: - c =5 + c = 5 elif T[node.x-1][node.y-1].plantType == 3: - c =13 + c = 13 elif T[node.x-1][node.y-1].plantType == 4: - c =100000 + c = 100000 else: - c=0 + c = 0 if T[node.x-1][node.y-1].isWet == 1: c = c + 4 else: - c=c+1 + c = c+1 return c @@ -92,7 +91,7 @@ def fieldCost(T,node): def cost(T, node): cost = 0 - while (node.get_parent() != None): + while node.get_parent() is not None: cost = cost + fieldCost(T, node) node = node.get_parent() @@ -103,7 +102,7 @@ def f(goaltest, map, node): return cost(map, node) + heuristic(goaltest, node) -def goal_test(elem,goaltest): +def goal_test(elem, goaltest): if elem.get_x() == goaltest[0] and elem.get_y() == goaltest[1]: return True else: @@ -132,7 +131,7 @@ def graphsearch(explored, f, fringe, goaltest, istate, map, succ): # przeszukiw explored_tuple.append((x.get_direction(), x.get_x(), x.get_y())) x = Node(action, state[0], elem[0], state[1], state[2]) # stworzenie nowego wierzchoÅ‚ka, którego rodzicem jest elem p = f(goaltest, map, x) # liczy priorytet - #print('Koszt =', p) + # print('Koszt =', p) if state not in fringe_tuple and state not in explored_tuple: # jeżeli stan nie znajduje siÄ™ na fringe oraz nie znajduje siÄ™ w liÅ›cie wierzchoÅ‚ków odwiedzonych fringe.append((x, p)) # dodanie wierzchoÅ‚ka na fringe fringe = sorted(fringe, key=itemgetter(1)) # sortowanie fringe'a wedÅ‚ug priorytetu @@ -141,7 +140,7 @@ def graphsearch(explored, f, fringe, goaltest, istate, map, succ): # przeszukiw for (state_prio, r) in fringe_tuple_prio: if str(state_prio) == str(state): if r > p: - fringe.insert(i, (x,p)) # zamiana state, który należy do fringe z priorytetem r na state z priorytetem p (niższym) + fringe.insert(i, (x, p)) # zamiana state, który należy do fringe z priorytetem r na state z priorytetem p (niższym) fringe.pop(i + 1) fringe = sorted(fringe, key=itemgetter(1)) # sortowanie fringe'a wedÅ‚ug priorytetu break @@ -154,7 +153,7 @@ def heuristic(goaltest, node): def print_moves(elem): moves_list = [] - while (elem.get_parent() != None): + while elem.get_parent() is not None: moves_list.append(elem.get_action()) elem = elem.get_parent() moves_list.reverse() @@ -184,7 +183,6 @@ def succ(elem): temp_move_east = elem.get_x() + 1 temp_move_north = elem.get_y() + 1 - if cart.Cart.is_move_allowed_succ(elem) == "x + 1": actions_list.append(("move", (elem.get_direction(), temp_move_east, elem.get_y()))) elif cart.Cart.is_move_allowed_succ(elem) == "y + 1": @@ -194,8 +192,4 @@ def succ(elem): elif cart.Cart.is_move_allowed_succ(elem) == "x - 1": actions_list.append(("move", (elem.get_direction(), temp_move_west, elem.get_y()))) - - - - - return actions_list \ No newline at end of file + return actions_list diff --git a/bfs.py b/bfs.py index 0f15cc8..d32614a 100644 --- a/bfs.py +++ b/bfs.py @@ -1,4 +1,3 @@ -import sys import cart import copy @@ -67,23 +66,19 @@ class Node: self.y = y -def goal_test(goaltest,elem): +def goal_test(goaltest, elem): if elem.get_x() == goaltest[0] and elem.get_y() == goaltest[1]: return True else: return False -# def graphsearch(explored, fringe, goaltest, istate, succ): # przeszukiwanie grafu wszerz -def graphsearch(explored, fringe, goaltest, istate): # przeszukiwanie grafu wszerz +def graphsearch(goaltest, istate): # przeszukiwanie grafu wszerz node = Node(None, istate.get_direction(), None, istate.get_x(), istate.get_y()) fringe = [] - #elem = [] explored = [] - #action = [] fringe.append(node) # wierzchoÅ‚ki do odwiedzenia - # fringe = [node] while True: if not fringe: return False @@ -109,7 +104,7 @@ def graphsearch(explored, fringe, goaltest, istate): # przeszukiwanie grafu wsz def print_moves(elem): moves_list = [] - while (elem.get_parent() != None): + while elem.get_parent() is not None: moves_list.append(elem.get_action()) elem = elem.get_parent() moves_list.reverse() @@ -139,7 +134,6 @@ def succ(elem): temp_move_east = elem.get_x() + 1 temp_move_north = elem.get_y() + 1 - if cart.Cart.is_move_allowed_succ(elem) == "x + 1": actions_list.append(("move", (elem.get_direction(), temp_move_east, elem.get_y()))) elif cart.Cart.is_move_allowed_succ(elem) == "y + 1": @@ -149,8 +143,4 @@ def succ(elem): elif cart.Cart.is_move_allowed_succ(elem) == "x - 1": actions_list.append(("move", (elem.get_direction(), temp_move_west, elem.get_y()))) - - - - - return actions_list \ No newline at end of file + return actions_list diff --git a/board.py b/board.py index 30cd4b9..66de6d9 100644 --- a/board.py +++ b/board.py @@ -1,6 +1,5 @@ import pygame from screen import SCREEN -global BLACK # global SCREEN global BLACK @@ -8,9 +7,9 @@ global gridObjects global imgTree global imgTree imgTree = pygame.image.load('img/tree.png') - gridObjects = {} # Store grid-box objects from Grid Class + class Grid(object): # ta klasa rysuje kratÄ™ na ekranie def __init__(self, x, y, sx, sy): @@ -27,6 +26,7 @@ class Grid(object): BLACK = (0, 0, 0) pygame.draw.rect(SCREEN, BLACK, (self.x, self.y, self.sx, self.sy), self.width) + class Box(object): # global SCREEN @@ -43,6 +43,7 @@ class Box(object): # global BLACK pygame.draw.rect(SCREEN, self.color, pygame.Rect(self.x, self.y, self.sx, self.sy)) + class Obstacle(object): def __init__(self, mouseObj): self.mseX = mouseObj[0] @@ -66,6 +67,7 @@ class Obstacle(object): SCREEN.blit(imgTree, (self.posX, self.posY)) # pygame.display.update() + def getGridBoxes(grid_box): - global gridObjects - return gridObjects[grid_box] \ No newline at end of file + global gridObjects + return gridObjects[grid_box] diff --git a/cart.py b/cart.py index 6fa4774..2e2dd93 100644 --- a/cart.py +++ b/cart.py @@ -25,7 +25,6 @@ class Cart: def set_y(self, y): self.y = y - def is_move_allowed(self, cart_rect): # sprawdza czy dany ruch, który chce wykonać wózek jest możliwy, zwraca prawdÄ™ lub faÅ‚sz if self.direction == definitions.CART_DIRECTION_EAST and cart_rect.x + definitions.BLOCK_SIZE < definitions.WIDTH_MAP: @@ -74,4 +73,3 @@ class Cart: self.direction = 1 else: self.direction = self.direction + 1 - diff --git a/classes.py b/classes.py index 741efe8..a95f3c4 100644 --- a/classes.py +++ b/classes.py @@ -1,11 +1,12 @@ class Field: def __init__(self, fieldType, plantType, isWet, wetTime, isFertilized, fertilizedTime): - self.fieldType =fieldType # good/bad - self.plantType =plantType # wheat/carrot/cabbage - self.isWet =isWet # yes/no - self.wetTime =wetTime # number - self.isFertilized =isFertilized # yes/no - self.fertilizedTime =fertilizedTime # number + self.fieldType = fieldType # good/bad + self.plantType = plantType # wheat/carrot/cabbage + self.isWet = isWet # yes/no + self.wetTime = wetTime # number + self.isFertilized = isFertilized # yes/no + self.fertilizedTime = fertilizedTime # number + class Plant: def __init__(self, plantType, growthState): @@ -21,4 +22,4 @@ class Fertilizer: class Player: x = 0 y = 0 - rotation = 0 \ No newline at end of file + rotation = 0 diff --git a/decisionTree/generator.py b/decisionTree/generator.py index 9681fe1..3954ac1 100644 --- a/decisionTree/generator.py +++ b/decisionTree/generator.py @@ -1,5 +1,6 @@ import random + # Generowanie unikalnej losowej linii tekstu def generate_unique_line(existing_lines): while True: @@ -9,6 +10,7 @@ def generate_unique_line(existing_lines): if line not in existing_lines: return line + # Generowanie 200 unikalnych linii tekstu lines = [] while len(lines) < 200: @@ -18,4 +20,4 @@ while len(lines) < 200: # Zapisywanie linii tekstu do pliku with open('decisionTree/database.txt', 'w') as file: for line in lines: - file.write(line + '\n') \ No newline at end of file + file.write(line + '\n') diff --git a/decisionTree/treemaker.py b/decisionTree/treemaker.py index 679930e..1c8d1c0 100644 --- a/decisionTree/treemaker.py +++ b/decisionTree/treemaker.py @@ -1,6 +1,4 @@ - - -#from sklearn.datasets import load_iris +# from sklearn.datasets import load_iris from sklearn.tree import export_text from sklearn.tree import DecisionTreeClassifier @@ -52,14 +50,14 @@ with open("decisionTree/database.txt", 'r') as f: view.append(x) X1.append(test_list) -f = open("decisionTree/learning_set.txt", "w") #zapisuje atrybuty s³ownie +f = open("decisionTree/learning_set.txt", "w") # zapisuje atrybuty s³ownie for i in view: f.write(str(i)+"\n") f.close() Y1 = [] -with open("decisionTree/decissions.txt", 'r') as f: #czyta decyzje +with open("decisionTree/decissions.txt", 'r') as f: # czyta decyzje for line in f: line = line.strip() test = int(line) @@ -67,7 +65,7 @@ with open("decisionTree/decissions.txt", 'r') as f: #czyta decyzje dataset = X1 decision = Y1 -labels = ['Rain','Plant','Temperature','Sun','Snow','Moisture','Rotten','Time'] +labels = ['Rain', 'Plant', 'Temperature', 'Sun', 'Snow', 'Moisture', 'Rotten', 'Time'] model = DecisionTreeClassifier(random_state=0, max_depth=20).fit(dataset, decision) filename = 'decisionTree/decisionTree.sav' print("Model trained") diff --git a/definitions.py b/definitions.py index af5ddd9..aabf9e8 100644 --- a/definitions.py +++ b/definitions.py @@ -1,5 +1,3 @@ -# definicje -import os import pygame pygame.init() @@ -21,4 +19,4 @@ HEIGHT_AMOUNT, WIDTH_AMOUNT = 11, 11 HEIGHT_MAP, WIDTH_MAP = BLOCK_SIZE * HEIGHT_AMOUNT, BLOCK_SIZE * WIDTH_AMOUNT HEIGHT, WIDTH = HEIGHT_MAP + BLOCK_SIZE, WIDTH_MAP IMAGE_SIZE_NEURAL_NETWORK = 16 -WINDOW = pygame.display.set_mode((WIDTH, HEIGHT)) \ No newline at end of file +WINDOW = pygame.display.set_mode((WIDTH, HEIGHT)) diff --git a/img/player.png b/img/player.png index 06176385e039fdf126fbbb8792bb93c3082c2061..a68aa644d83f9bf9df1e177930e961c78afa4195 100644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G|1l~*iSZtYTlaeAP5~fHT z8vQ3B&%biz#>I12l#-??`u(!=K4euw5r9!5NC5G`K^c{#rZA(>JhR;1J$s4IV`Jqq z=dvuX)qG_Di`=F|(S}mlHroO!10Xu}+yRbIsUCrlpSFeX+YUVGTRW7G(EiJ~HATG;tUlU;ffsyfJFj@bu zCnB!yxq5Za)z9sH;-+t3Vu%YBhuPIcvVq^Jek^9Ak_zUh?nE^oSu+0~7p{!~{k(>a7uWRwxv)~=y{oK#zcPx6nyyF_n zhn{-nk*{vLvE%HtG(&e57A(y!{nPp%jIL=P860Y_&Zuufo* zd+y>=+Vr1pdfmEpC+8JRsk>t-5e?K2B$>YTy+7?T-H&g2;NJUQDE0Z9Zd$)`;kyqU z+be?SoU!E2o9|z_=sg{6bFE3Hw&T~W@oe!!}m$p6f&~4Ygt9SQK zX3l(laP)BQvs0Q(gV)gSezxIL7o53vap}6ZxBT))-<)pxw7(xHhR>{7ezdQ*sip1i zM_)-xQ-@5JHg@?XR{+4WORktM>~welFz4)Z0AT)-b5A4pba+Y|05J9hJMazX zWwmht7(CSb7V(A$4g col: # Away from the Left Border of the Screen if grid > (col*row)-col: # You are on the Right Border of the screen - You can't go East miniG[grid] = [gN, gS, gW] - else: # Away from the Right Border of the Screen - You can go East + else: # Away from the Right Border of the Screen - You can go East miniG[grid] = [gN, gS, gE, gW] - else: # You are on the Left Edge of the screen - You can't go West + else: # You are on the Left Edge of the screen - You can't go West miniG[grid] = [gN, gS, gE] # FILTER OUT OBSTACLES FROM THE GRAPH @@ -199,7 +197,7 @@ def generateGraph(row,col): if grid not in gridObstacle: # gridObjects.remove(grid) # Dict object has no attribute : 'remove' # HACK - miniG2[grid] = miniG[grid] # Created a new dictionary that stored the values required + miniG2[grid] = miniG[grid] # Created a new dictionary that stored the values required # IN-DEPTH FILTER - Filter out obstacles from the neighbors-list for neigbor in miniG2[grid]: if neigbor in gridObstacle: @@ -214,12 +212,13 @@ def generateGraph(row,col): return miniG2 -def drawGraph(pathF): - #Draws the path given the path-list - global Ucelu - #print(pathF) - if (Ucelu == False): +def drawGraph(pathF): + # Draws the path given the path-list + global Ucelu + # print(pathF) + + if not Ucelu: for grid in pathF: # g = gridObjects[grid] # Get the grid-box object mentioned in the path # x = g.x @@ -232,9 +231,9 @@ def drawGraph(pathF): if grid == 'rotate_right': player.rotation = (player.rotation - 90) % 360 if grid == 'rotate_left': - player.rotation = (player.rotation + 90) %360 + player.rotation = (player.rotation + 90) % 360 - #( player.rotation) + # (player.rotation) if grid == 'move': if player.rotation == 0: @@ -250,49 +249,11 @@ def drawGraph(pathF): if player.y > 0: player.y = player.y - 1 - - # if player.x < (x/50 - 1): - # a = 1 - # if player.x > (x/50 - 1): - # a =2 - # if player.y < (y/50 - 1): - # a =3 - # if player.y > (y/50 - 1): - # a =4 - # - # if a==1: - # # player.x = x/50 - 1 - # player.rotation = 0 - # if a==2: - # # player.x = x/50 - 1 - # player.rotation = 180 - # if a==3: - # # player.y = y/50 - 1 - # player.rotation = 270 - # if a==4: - # # player.y = y/50 - 1 - # player.rotation = 90 - - - # tmpImg = pygame.transform.rotate(imgPlayer, player.rotation) - # if player.rotation == 180: - # tmpImg = pygame.transform.flip(tmpImg, True, True) - # tmpImg = pygame.transform.flip(tmpImg, True, False) - # - # #player is seen on the way - # SCREEN.blit(tmpImg, (55 + 50 * player.x, 55 + 50 * player.y)) - # pygame.display.update() - # # pygame.time.wait(300) - - # player.y = y/50 - 1 - # player.x = x/50 - 1 - - # ----------------------------- i = 0 while i < len(T): j = 0 while j < len(T[i]): - #color = (255, 255, 255, 0) + # color = (255, 255, 255, 0) if T[i][j].isWet == 0: # a = 1 color = (160, 80, 40, 0) @@ -300,7 +261,7 @@ def drawGraph(pathF): # a = 1 color = (50, 25, 0, 0) - #Covers 'player' on the way + # Covers 'player' on the way pygame.draw.rect(SCREEN, color, pygame.Rect(50 + 50 * i, 50 + 50 * j, 50, 50)) if T[i][j].plantType == 1: SCREEN.blit(imgWheat, (50 + 50 * i, 50 + 50 * j)) @@ -318,7 +279,6 @@ def drawGraph(pathF): for obs in obstacleObjects: obstacleObjects[obs].draw() - for bx in boxObjects: boxObjects[bx].draw() @@ -333,30 +293,21 @@ def drawGraph(pathF): tmpImg = pygame.transform.flip(tmpImg, True, True) tmpImg = pygame.transform.flip(tmpImg, True, False) - #player is seen on the way + # player is seen on the way SCREEN.blit(tmpImg, (55 + 50 * player.x, 55 + 50 * player.y)) - # -------------------------------------- - - # tmpImg = pygame.transform.rotate(imgPlayer, player.rotation) - # # if flip: - # # if flip == True: - # if player.rotation == 180: - # tmpImg = pygame.transform.flip(tmpImg, True, True) - # tmpImg = pygame.transform.flip(tmpImg, True, False) - # - # SCREEN.blit(tmpImg, (55 + 50 * player.x, 55 + 50 * player.y)) - pygame.display.update() pygame.time.wait(300) - SCREEN.fill((WHITE)) + SCREEN.fill(WHITE) # pygame.time.wait(50) # pygame.draw.rect(SCREEN, WHITE, pygame.Rect(x, y, sx, sy)) Ucelu = True -def UIHandler(mouseObj): + + +def UIHandler(): # drawGrid(GRIDX, GRIDY) global Ucelu - drawGrid(10,10) + drawGrid(10, 10) for grid in gridObjects: gridObjects[grid].draw() @@ -368,10 +319,10 @@ def UIHandler(mouseObj): obstacleObjects[obs].draw() if pathFound: - drawGraph(pathFound) - # Ucelu = False + drawGraph(pathFound) -def eventHandler(kbdObj,mouseObj): + +def eventHandler(kbdObj, mouseObj): global boxes global obstacles global startNode @@ -380,7 +331,7 @@ def eventHandler(kbdObj,mouseObj): global Ucelu if event.type == pygame.QUIT: - running = False + pygame.quit() if event.type == pygame.KEYDOWN: pygame.time.wait(DELAY) @@ -426,15 +377,10 @@ def eventHandler(kbdObj,mouseObj): # If Key_f is pressed, set goal node if kbdObj[pygame.K_f]: gBox = getGridBoxes(int(len(gridObjects))) - # gBox = getGridBoxes() - #x = mouseObj[0] - #y = mouseObj[1] - # x = gBox.x - # y = gBox.y sx = gBox.sx sy = gBox.sy - # ---------------------------------------- + mseX = mouseObj[0] mseY = mouseObj[1] @@ -444,15 +390,11 @@ def eventHandler(kbdObj,mouseObj): y = g.y sx = g.sx sy = g.sy - if mseX > x and mseX < x + sx: - if mseY > y and mseY < y + sy: + if x < mseX < x + sx: + if y < mseY < y + sy: posX = x posY = y - gridBox = grid - # SCREEN.blit(imgTree, (posX, posY)) - - # --------------------------------------- bo = Box(posX, posY, sx, sy, BLUE) boxObjects[boxes] = bo # boxes += 1 @@ -470,9 +412,6 @@ def eventHandler(kbdObj,mouseObj): print(' goalNode x=', goalNode[0], 'goalNode y=', goalNode[1]) - - - # pygame.display.update() # goalNode = (x/sx) * (y/sy) @@ -482,10 +421,10 @@ def eventHandler(kbdObj,mouseObj): # If Key_x is pressed, spawn tree if kbdObj[pygame.K_t]: w = random.randint(0, 1) - f=random.randint(0, 1) + f = random.randint(0, 1) print(w) print(f) - img = generate(w,f,random.randint(0,2)) + img = generate(w, f, random.randint(0, 2)) img.save('./test/00/test.png') data_transform = transforms.Compose([ @@ -500,15 +439,15 @@ def eventHandler(kbdObj,mouseObj): target_transform=None) model1.eval() res = model1(train_data[0][0]) - if res[0] ==res.max(): + if res[0] == res.max(): print("0 0") - if res[1] ==res.max(): + if res[1] == res.max(): print("0 1") - if res[2] ==res.max(): + if res[2] == res.max(): print("1 0") - if res[3] ==res.max(): + if res[3] == res.max(): print("1 1") - #img.show() + # img.show() if kbdObj[pygame.K_x]: obs = Obstacle(mouseObj) obstacleObjects[obstacles] = obs @@ -527,44 +466,22 @@ def eventHandler(kbdObj,mouseObj): y = g.y sx = g.sx sy = g.sy - if mseX > x and mseX < x + sx: - if mseY > y and mseY < y + sy: + if x < mseX < x + sx: + if y < mseY < y + sy: posX = x posY = y - T[int((posX/50)-1)][int((posY/50)-1)].plantType=4 - + T[int((posX/50)-1)][int((posY/50)-1)].plantType = 4 pygame.display.update() pygame.time.wait(DELAY) - # if Key_SPACE is pressed, start the magic if kbdObj[pygame.K_SPACE]: Ucelu = False - gBox = getGridBoxes(1) - x = gBox.x - y = gBox.y - sx = gBox.sx - sy = gBox.sy - - x = (player.x +1) * 50 - y = (player.y +1) * 50 - - # tmpImg = pygame.transform.rotate(imgPlayer, player.rotation) - # SCREEN.blit(tmpImg, (50 + 50 * player.x, 50 + 50 * player.y)) - # pygame.display.update() - - #when on it keeps flashing - among others - #bo = Box(x, y, sx, sy, RED) - #boxObjects[boxes] = bo - - # boxes += 1 boxes = 1 - # startNode.state = (10 * (player.x + 1) + (player.y + 1) - 10) - startNode.x = player.x + 1 startNode.y = player.y + 1 @@ -579,15 +496,12 @@ def eventHandler(kbdObj,mouseObj): print(' startNode x=', startNode.x, 'startNode y= ', startNode.y, 'startNode direction =', startNode.direction) - graph = generateGraph(GRIDY,GRIDX) + graph = generateGraph(GRIDY, GRIDX) print(graph) - # if startNode != goalNode: if startNode.x != goalNode[0] or startNode.y != goalNode[1]: - elem = [] - - move_list = (graphsearch([], [], goalNode, startNode)) # przeszukiwanie grafu wszerz + move_list = (graphsearch(goalNode, startNode)) # przeszukiwanie grafu wszerz pathFound = move_list @@ -599,32 +513,11 @@ def eventHandler(kbdObj,mouseObj): pygame.time.wait(DELAY) # startNode = goalNode - if kbdObj[pygame.K_b]: Ucelu = False - gBox = getGridBoxes(1) - x = gBox.x - y = gBox.y - sx = gBox.sx - sy = gBox.sy - - x = (player.x +1) * 50 - y = (player.y +1) * 50 - - # tmpImg = pygame.transform.rotate(imgPlayer, player.rotation) - # SCREEN.blit(tmpImg, (50 + 50 * player.x, 50 + 50 * player.y)) - # pygame.display.update() - - #when on it keeps flashing - among others - #bo = Box(x, y, sx, sy, RED) - #boxObjects[boxes] = bo - - # boxes += 1 boxes = 1 - # startNode.state = (10 * (player.x + 1) + (player.y + 1) - 10) - startNode.x = player.x + 1 startNode.y = player.y + 1 @@ -639,22 +532,11 @@ def eventHandler(kbdObj,mouseObj): print(' startNode x=', startNode.x, 'startNode y= ', startNode.y, 'startNode direction =', startNode.direction) - # startNode = (((player.x + 1)*10 - 9) * (player.y + 1) ) - # startNode = 2 - - # tmpImg = pygame.transform.rotate(imgPlayer, player.rotation) - # SCREEN.blit(tmpImg, (55 + 50 * player.x, 55 + 50 * player.y)) - # pygame.display.update() - - # Delay to avoid multiple spawning of objects - #pygame.time.wait(DELAY) - - graph = generateGraph(GRIDY,GRIDX) + graph = generateGraph(GRIDY, GRIDX) print(graph) # if startNode != goalNode: if startNode.x != goalNode[0] or startNode.y != goalNode[1]: - elem = [] move_list = (astar.graphsearch([], astar.f, [], goalNode, startNode, T, succ)) # przeszukiwanie grafu wszerz @@ -665,17 +547,11 @@ def eventHandler(kbdObj,mouseObj): print(move_list) print('\n') - - # else: - # startNode = (10 * (player.x + 1) + (player.y + 1) - 10) - # Ucelu = True - # Delay to avoid multiple spawning of objects pygame.time.wait(DELAY) - #With it it keeps going, if without it turns off + # With it it keeps going, if without it turns off - # Ucelu = False T = [[Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,2,1,0,0,0),Field(1,3,0,0,0,0),Field(0,3,0,0,0,0),Field(0,0,1,0,0,0),Field(0,0,0,0,0,0),Field(1,3,1,0,0,0),Field(1,0,0,0,0,0),Field(1,0,1,0,0,0)], [Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,0,1,0,0,0),Field(1,3,1,0,0,0),Field(0,0,0,0,0,0),Field(0,0,0,0,0,0),Field(0,0,0,0,0,0),Field(1,3,1,0,0,0),Field(1,0,0,0,0,0),Field(1,0,1,0,0,0)], @@ -688,20 +564,6 @@ T = [[Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,2,1,0,0,0),Field(1,3,0,0,0,0 [Field(1,0,0,0,0,0),Field(0,2,0,0,0,0),Field(1,1,0,0,0,0),Field(1,0,1,0,0,0),Field(0,2,1,0,0,0),Field(0,3,0,0,0,0),Field(0,0,0,0,0,0),Field(1,0,1,0,0,0),Field(1,0,0,0,0,0),Field(1,0,1,0,0,0)], [Field(1,0,1,0,0,0),Field(0,0,0,0,0,0),Field(1,1,1,0,0,0),Field(1,0,0,0,0,0),Field(0,1,1,0,0,0),Field(0,0,1,0,0,0),Field(0,0,0,0,0,0),Field(1,0,1,0,0,0),Field(1,0,0,0,0,0),Field(1,0,1,0,0,0)]] - -#T = [[Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,2,1,0,0,0),Field(1,3,0,0,0,0),Field(0,3,0,0,0,0),Field(0,0,1,0,0,0),Field(0,3,0,0,0,0),Field(1,0,1,0,0,0),Field(1,3,0,0,0,0),Field(1,2,1,0,0,0)], -# [Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,0,1,0,0,0),Field(1,3,1,0,0,0),Field(0,0,0,0,0,0),Field(0,0,0,0,0,0),Field(0,2,0,0,0,0),Field(1,1,0,0,0,0),Field(1,0,1,0,0,0),Field(1,1,0,0,0,0)], -# [Field(0,2,1,0,0,0),Field(0,0,1,0,0,0),Field(1,0,0,0,0,0),Field(1,0,0,0,0,0),Field(0,2,1,0,0,0),Field(0,1,1,0,0,0),Field(0,2,0,0,0,0),Field(1,0,0,0,0,0),Field(1,0,0,0,0,0),Field(1,1,0,0,0,0)], -# [Field(1,0,1,0,0,0),Field(0,0,1,0,0,0),Field(1,1,1,0,0,0),Field(1,2,0,0,0,0),Field(0,3,1,0,0,0),Field(0,1,0,0,0,0),Field(0,0,0,0,0,0),Field(1,2,0,0,0,0),Field(1,0,0,0,0,0),Field(1,0,0,0,0,0)], -# [Field(1,3,0,0,0,0),Field(0,3,1,0,0,0),Field(1,2,1,0,0,0),Field(1,1,1,0,0,0),Field(0,1,1,0,0,0),Field(0,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,0,1,0,0,0),Field(1,3,0,0,0,0),Field(1,0,1,0,0,0)], -# [Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,1,1,0,0,0),Field(1,2,0,0,0,0),Field(0,1,0,0,0,0),Field(0,2,0,0,0,0),Field(0,1,0,0,0,0),Field(1,0,1,0,0,0),Field(1,0,0,0,0,0),Field(1,1,1,0,0,0)], -# [Field(1,0,0,0,0,0),Field(0,0,0,0,0,0),Field(1,1,1,0,0,0),Field(1,2,0,0,0,0),Field(0,0,1,0,0,0),Field(0,0,1,0,0,0),Field(0,1,0,0,0,0),Field(1,2,1,0,0,0),Field(1,2,1,0,0,0),Field(1,0,0,0,0,0)], -# [Field(1,0,0,0,0,0),Field(0,0,1,0,0,0),Field(1,3,1,0,0,0),Field(1,2,1,0,0,0),Field(0,0,1,0,0,0),Field(0,0,0,0,0,0),Field(0,1,1,0,0,0),Field(1,0,0,0,0,0),Field(1,1,1,0,0,0),Field(1,1,1,0,0,0)], -# [Field(1,0,0,0,0,0),Field(0,2,0,0,0,0),Field(1,1,0,0,0,0),Field(1,0,1,0,0,0),Field(0,2,1,0,0,0),Field(0,3,0,0,0,0),Field(0,0,0,0,0,0),Field(1,0,0,0,0,0),Field(1,2,1,0,0,0),Field(1,2,1,0,0,0)], -# [Field(1,0,1,0,0,0),Field(0,0,0,0,0,0),Field(1,1,1,0,0,0),Field(1,0,0,0,0,0),Field(0,1,1,0,0,0),Field(0,0,1,0,0,0),Field(0,1,0,0,0,0),Field(1,1,1,0,0,0),Field(1,0,1,0,0,0),Field(1,0,0,0,0,0)]] - - - # ========================================================================================= # no i tutaj mamy główna pÄ™tlÄ™ programu @@ -718,12 +580,12 @@ while running: for event in pygame.event.get(): kbd = pygame.key.get_pressed() mse = pygame.mouse.get_pos() - UIHandler(mse) + UIHandler() eventHandler(kbd, mse) pygame.display.update() # CLOCK.tick(FPS) - #screen.fill((175, 255, 50, 0)) + # screen.fill((175, 255, 50, 0)) # SCREEN.fill((WHITE)) imgWheat = pygame.image.load('img/wheat.png') @@ -745,7 +607,7 @@ while running: else: # a = 1 color = (50, 25, 0, 0) - #colour from the beginning + # colour from the beginning pygame.draw.rect(SCREEN, color, pygame.Rect(50 + 50 * i, 50 + 50 * j, 50, 50)) if T[i][j].plantType == 1: SCREEN.blit(imgWheat, (50 + 50 * i, 50 + 50 * j)) @@ -756,7 +618,6 @@ while running: if T[i][j].plantType == 4: SCREEN.blit(imgTree, (50 + 50 * i, 50 + 50 * j)) - j = j + 1 i = i + 1 @@ -770,34 +631,26 @@ while running: obstacleObjects[obs].draw() # if startNode.state != goalNode.state: - if startNode.x != goalNode[0] or startNode.y != goalNode[1] : + if startNode.x != goalNode[0] or startNode.y != goalNode[1]: for bx in boxObjects: boxObjects[bx].draw() - tmpImg = pygame.transform.rotate(imgPlayer, player.rotation) if player.rotation == 180: tmpImg = pygame.transform.flip(tmpImg, True, True) tmpImg = pygame.transform.flip(tmpImg, True, False) - #player seen at the beginning + # player seen at the beginning SCREEN.blit(tmpImg, (55 + 50 * player.x, 55 + 50 * player.y)) - - - # if Ucelu == False: - # for bx in boxObjects: - # boxObjects[bx].draw() - - - font = pygame.font.SysFont('comicsans', 18) - label = font.render('f- punkt koÅ„cowy, x- drzewa, spacja- uruchomienie', 1, (0, 0, 0)) - label1 = font.render('strzaÅ‚ki-rÄ™czne poruszanie traktorem,', 1, (0, 0, 0)) - label2 = font.render('a- obrót w lewo, d- w prawo, w-ruch naprzód', 1, (0, 0, 0)) - label3 = font.render('b - uruchom A*', 1, (0, 0, 0)) - SCREEN.blit(label, (10, 570)) - SCREEN.blit(label1, (10, 590)) - SCREEN.blit(label2, (10, 610)) + font = pygame.font.SysFont('comicsans', 22) + label = font.render('F - cel | X - drzewo', True, (0, 0, 0)) + label1 = font.render('ARROWS - rÄ™czne poruszanie', True, (0, 0, 0)) + label2 = font.render('A - lewo | D - prawo | W - ruch', True, (0, 0, 0)) + label3 = font.render('SPACE - start BFS | B - start A*', True, (0, 0, 0)) + SCREEN.blit(label, (10, 555)) + SCREEN.blit(label1, (10, 580)) + SCREEN.blit(label2, (10, 605)) SCREEN.blit(label3, (10, 630)) # pygame.display.flip() @@ -807,4 +660,4 @@ while running: # Done! Time to quit. -pygame.quit() \ No newline at end of file +pygame.quit() diff --git a/screen.py b/screen.py index aeaf534..e7ecb42 100644 --- a/screen.py +++ b/screen.py @@ -1,2 +1,2 @@ import pygame -SCREEN = pygame.display.set_mode([600,665]) \ No newline at end of file +SCREEN = pygame.display.set_mode([600, 665]) -- 2.20.1