diff --git a/agent.py b/agent.py index 844383d..0aef235 100644 --- a/agent.py +++ b/agent.py @@ -103,7 +103,7 @@ def take_food(self): house_x = 3 house_y = 1 if self.x == house_x and self.y == house_y: - if self._dryfood == 0 and self._wetfood == 0: + if self._dryfood == 0 or self._wetfood == 0: self._dryfood = 50 self._wetfood = 50 print("Agent took food and current food level is", self._dryfood, self._wetfood) diff --git a/main.py b/main.py index 9db1c17..4dde02a 100644 --- a/main.py +++ b/main.py @@ -114,7 +114,7 @@ def main(): agent.move(action, const.GRID_WIDTH, const.GRID_HEIGHT, obstacles, Animals, goal,const) pygame.time.wait(200) else: - if agent._dryfood != 0 or agent._wetfood != 0 : + if agent._dryfood != 0 and agent._wetfood != 0 : animal = random.choice(Animals) goal = (animal.x, animal.y) draw_goal(const, goal) diff --git a/tree.png b/tree.png index 752e5b2..895e5b5 100644 Binary files a/tree.png and b/tree.png differ