上一页 1 ··· 5 6 7 8 9
摘要: 如果你在看集体编程智慧这本书,第五章的遗传算法时候,出现这样的错误:TypeError: object of type 'NoneType' has no len()。。请注意下面这个函数: def mutate(vec): i=random.randint(0,len(domain)-1) if random.random()domain[i][0]: return vec[0:i]+[vec[i]-step]+vec[i+1:] elif vec[i]domain[i][0]: return vec[0:i]+[vec[i]-step]+vec[i+1:] elif vec 阅读全文
posted @ 2013-07-21 15:06 joey周琦 阅读(666) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9