agent walking until he meets an object
This commit is contained in:
parent
ee00c85b80
commit
ef8dd038a6
8
model.py
8
model.py
@ -5,8 +5,8 @@ from mesa.space import MultiGrid
|
|||||||
#from mesa.datacollection import DataCollector
|
#from mesa.datacollection import DataCollector
|
||||||
import random
|
import random
|
||||||
|
|
||||||
x = 11
|
x = 10
|
||||||
y = 11
|
y = 10
|
||||||
possible_contents = ['gold', 'sword', 'shield', 'potion', 'empty']
|
possible_contents = ['gold', 'sword', 'shield', 'potion', 'empty']
|
||||||
step_counter = 0
|
step_counter = 0
|
||||||
boxes_number = 5
|
boxes_number = 5
|
||||||
@ -18,7 +18,9 @@ class GameMap(Model):
|
|||||||
self.schedule = RandomActivation(self) # agenci losowo po kolei wykonują swoje akcje
|
self.schedule = RandomActivation(self) # agenci losowo po kolei wykonują swoje akcje
|
||||||
# to jest potrzebne przy założeniu, że potwory chodzą?
|
# to jest potrzebne przy założeniu, że potwory chodzą?
|
||||||
self.boxes_number = boxes_number
|
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)
|
x = self.random.randrange(self.grid.width)
|
||||||
y = self.random.randrange(self.grid.height)
|
y = self.random.randrange(self.grid.height)
|
||||||
self.grid.place_agent(player, (x, y))
|
self.grid.place_agent(player, (x, y))
|
||||||
|
Loading…
Reference in New Issue
Block a user