Esempio n. 1
0
    def test_infiniteRadium(self):

        self.automaton.reinit(ROWS, COLUMNS)
        self.automaton.createPopulation(POPULATION, Agent.infiniteRadium())
        self.simulation.start(ITERATIONS)
        self.assertTrue(self.automaton.convergence, "IT IS CONVERGENCE")
        array = self.automaton.getMatrixOfPopulation()
        # print repr(self.automaton) + " " + repr(array.max())
        self.assertEqual(POPULATION, len(self.automaton.getAgents()), "ALL AGENTS")
Esempio n. 2
0
    def test_random(self):

        self.automaton.reinit(ROWS, COLUMNS)
        self.automaton.createPopulation(POPULATION, Agent.infiniteRadium(), Agent.randomFitness)
        self.simulation.start(ITERATIONS)
        self.assertFalse(self.automaton.convergence, " IT IS NOT CONVERGENCE")