world.playground.writelayer("RESULT", False, overwrite) def main(): try: setmaps(options["costmap"], options["outputmap"]) except error.DataError: grass.fatal("Failed to parse args..") sys.exit(1) if options["maxagents"]: maxagents = int(options["maxagents"]) else: maxagents = 99 if options["agentslife"]: agentslife = int(options["agentslife"]) else: agentslife = 99 if options["mark"]: mark = int(options["mark"]) else: mark = 99 run(int(options["rounds"]), maxagents, agentslife, mark, flags["p"]) grass.message("FINISH") if __name__ == "__main__": options, flags = grass.parser() world = world.World(grassland.Grassland()) main()
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]
def setUp(self): self.world = world.World()