Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fitness文件保存的问题 #19

Closed
littletomatodonkey opened this issue May 12, 2018 · 2 comments
Closed

fitness文件保存的问题 #19

littletomatodonkey opened this issue May 12, 2018 · 2 comments
Labels

Comments

@littletomatodonkey
Copy link

您好,我想问一下怎么修改代码使得可以自定义文件保存的结果呢?现在每次都是best_fit.py,谢谢!

@PytLab
Copy link
Owner

PytLab commented May 13, 2018

gaft支持on-the-fly analysis 插件的编写

  1. https://github.com/PytLab/gaft/blob/master/gaft/analysis/fitness_store.py 是内置生成best_fit.py的plugin,你可以根据这个编写属于自己的plugin,gaft会在迭代的时候回调相应的函数。
  2. 所有的analyasis plugin类都继承自OnTheFlyAnalysis具体可以参考:https://github.com/PytLab/gaft/blob/master/gaft/plugin_interfaces/analysis.py
  3. gaft中可以通过装饰器将你自定义的analysis注册到engine中,可以参考这个例子脚本:https://github.com/PytLab/gaft/blob/master/examples/ex01/ex01.py#L44

@littletomatodonkey
Copy link
Author

嗯嗯好的,我已经按照您的提示实现了一个自定义保存的分析类,里面可以修改保存结果的文件名,谢谢您的提示了!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants