Ejemplo n.º 1
0
            world.maxants = int(options['maxants'])
        if options['antslife']:
            world.antslife = int(options['antslife'])
        if options['decisionalgorithm']:
            world.decisionbase = str(options['decisionalgorithm'])
        if options['evaluateposition']:
            world.evaluationbase = str(options['evaluateposition'])
#        if options['agentfreedom']:
#            world.globalfreedom = int(options['agentfreedom'])
        if options['pheromoneweight']:
            world.pheroweight = int(options['pheromoneweight'])
        if options['randomnessweight']:
            world.randomweight = int(options['randomnessweight'])
        if options['costweight']:
            world.costweight = int(options['costweight'])
        #if arglist[0] == "stability":
        #TODO ask silvia..


#        world.checkvalues()
    except error.DataError:
        grass.fatal("Failed to parse args..")
        sys.exit(1)
    letantsdance(int(options['rounds']), int(options['outrounds']))
    grass.message("FINISH")

if __name__ == "__main__":
    options, flags = grass.parser()
    world = anthill.Anthill(grassland.Grassland())
    main()
Ejemplo n.º 2
0
 def setUp(self):
     self.pg = playground.Playground()
     self.pg.setregion(3,3)
     self.world = anthill.Anthill(self.pg)
     self.world.sites = [[1,1]]