Ejemplo n.º 1
0
 def __init__(self, pg=None, agenttype=None):
     """
     Create a World, a place with a playground, where agents meet
     @param type optional, the default agent type for this world
     @param playground optional, if playground already exists
     """
     # set an initial playground, as every world wants at least one..
     if pg is None:
         self.playground = playground.Playground()
     else:
         self.playground = pg
     # per default, create this kind of agents
     if agenttype is None:
         self.agenttype = agent.Agent
     else:
         self.agenttype = agenttype
     # list of agents
     self.agents = []
Ejemplo n.º 2
0
 def setUp(self):
     self.pg = playground.Playground()
     self.pg.setregion(3, 3)
     self.world = world.World(self.pg, None)
     self.world.bear(1, [1, 1], agent.Agent)
     self.agent = self.world.agents[0]
Ejemplo n.º 3
0
 def setUp(self):
     self.pg = playground.Playground()
     self.pg.setregion(3,3)
     self.world = anthill.Anthill(self.pg)
     self.world.sites = [[1,1]]
 def setUp(self):
     self.pg = playground.Playground()