From ef8dd038a6f4877c2b083a9cbb3042e00f237d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joanna=20Rado=C5=82a?= Date: Tue, 16 Mar 2021 16:06:56 +0100 Subject: [PATCH] agent walking until he meets an object --- model.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/model.py b/model.py index 677f00e..9bc4ee8 100644 --- a/model.py +++ b/model.py @@ -5,8 +5,8 @@ from mesa.space import MultiGrid #from mesa.datacollection import DataCollector import random -x = 11 -y = 11 +x = 10 +y = 10 possible_contents = ['gold', 'sword', 'shield', 'potion', 'empty'] step_counter = 0 boxes_number = 5 @@ -18,7 +18,9 @@ class GameMap(Model): self.schedule = RandomActivation(self) # agenci losowo po kolei wykonują swoje akcje # to jest potrzebne przy założeniu, że potwory chodzą? self.boxes_number = boxes_number - player = Player(1, self) + self.running=True + player = Player(1000, self) + self.schedule.add(player) x = self.random.randrange(self.grid.width) y = self.random.randrange(self.grid.height) self.grid.place_agent(player, (x, y)) @@ -55,4 +57,4 @@ class Box(Agent): possible_contents) # lepiej od razu przypisać content zamiast w ogóle dawać unknown? def step(self): - pass + pass \ No newline at end of file