Beispiel #1
0
 def generate_full_agents(self):
     self.ants = []
     self.rules = []
     for i in range(self.grid_size):
         for j in range(self.grid_size):
             self.ants.append(Ant(i , j))
             self.rules.append(Rules.generate_random_rules())
Beispiel #2
0
 def generate_random_agents(self, nr_agents):
     self.ants = []
     self.rules = []
     for i in range(nr_agents):
         pos_x = rnd.randint(0, self.grid_size - 1)
         pos_y = rnd.randint(0, self.grid_size - 1)
         self.ants.append(Ant(pos_x , pos_y))
         self.rules.append(Rules.generate_random_rules())
Beispiel #3
0
 def generate_diagonal_agents(self, nr_agents):
     self.ants = []
     self.rules = []
     for i in range(nr_agents):
         range_start = i * self.grid_size / nr_agents
         range_end = (i + 1) * self.grid_size / nr_agents - 1
         pos_x = rnd.randint(range_start,range_end)
         pos_y = rnd.randint(range_start,range_end)
         self.ants.append(Ant(pos_x , pos_y))
         self.rules.append(Rules.generate_random_rules())