diff --git a/agent.py b/agent.py index 3fd9e6f..096b9d2 100644 --- a/agent.py +++ b/agent.py @@ -19,7 +19,7 @@ class Node: def __repr__(self): return "Node:{}x{}".format(self.x, self.y) - + class Agent: def __init__(self, start_x, start_y, assigned_warehouse, radius=5): self.x = start_x @@ -80,7 +80,6 @@ class Agent: def get_neighbours(self, node: Node): neighbours = [] - print(neighbours) if self.check_if_can_move(Coordinates(node.x + 1, node.y)): neighbours.append(Node(node.x + 1, node.y)) if self.check_if_can_move(Coordinates(node.x - 1, node.y)): @@ -97,6 +96,7 @@ class Agent: return else: next = self.path.pop() + print(next.x, next.y) self.x = next.x self.y = next.y self.closed = [] diff --git a/main.py b/main.py index 7608b35..44cffbf 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ import agent import random import sys from attributes import PackSize, PackStatus, COLORS -import pdb + WINDOW_SIZE = (600, 600) COLOR_OF_FIELD = { 'Floor': 'gray', @@ -34,11 +34,9 @@ class MainGameFrame: self.draw_floor() self.draw_packages() self.draw_agent() - # pdb.set_trace() self.agent.move() pygame.display.update() - # pdb.set_trace() - self.clock.tick(2) + self.clock.tick(1) def draw_floor(self): for x in range(self.warehouse_map.width):