agent walking until he meets an object

This commit is contained in:
Joanna Radoła 2021-03-16 16:06:56 +01:00
parent ee00c85b80
commit ef8dd038a6

View File

@ -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))