agent walking until he meets an object
This commit is contained in:
parent
ee00c85b80
commit
ef8dd038a6
10
model.py
10
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
|
Loading…
Reference in New Issue
Block a user