コード例 #1
0
 def init_citizen(self):
     citizen = Citizen()
     tsize = len(self.data.ga_target)
     for j in range(tsize):
         citizen.str = citizen.str + str(
             chr((random.randint(0, 32767) % 90) + 32))
     return citizen
コード例 #2
0
 def init_citizen(self):
     citizen = Citizen()
     entries = []
     for i in range(self.genes_num):
         citizen.str = citizen.str + "-"
         entries.append(i)
     self.init_character(citizen, '?', entries)
     self.init_character(citizen, '1', entries)
     self.init_character(citizen, '0', entries)
     return citizen