PytLab / gaft

A Genetic Algorithm Framework in Python (not for production level)
http://gaft.readthedocs.io/
GNU General Public License v3.0
738 stars 218 forks source link

如何获取每一步迭代后各维度变量的值? #35

Closed TransUMD closed 5 years ago

TransUMD commented 5 years ago

作者您好, 其实我只想将例子中: indv_template = BinaryIndividual(ranges=[(0, 10), (0, 10),(0, 10)], eps=0.5) 中的多维变量实时提取出来,赋给外部环境来计算FitnessValue.....

谢谢

PytLab commented 5 years ago

你好,gaft提供了OnTheFlyAnalysis来自定义迭代中的分析类,可以参考这个例子中的使用https://github.com/PytLab/gaft/blob/master/examples/ex01/ex01.py

定义好了analysis后便可将其注册到engine中,在迭代的过程中你的analysis方法将会被调用完成你需要的任务

TransUMD commented 5 years ago

谢谢!