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

自定义individual类 #41

Open
wulidongdong opened this issue Dec 24, 2018 · 3 comments
Open

自定义individual类 #41

wulidongdong opened this issue Dec 24, 2018 · 3 comments
Assignees

Comments

@wulidongdong
Copy link

你好,
我自定义了一个invidual类,但是在跑的过程中在crossover操作时,在clone那一步报错了。
因为我的invidual在初始化时需要传入额外的参数,具体错误看截图,请问有什么解决办法吗?谢谢
image

@PytLab
Copy link
Owner

PytLab commented Dec 24, 2018

可否提供一下你定义的Individual类呢?

@PytLab PytLab added the bug label Dec 24, 2018
@PytLab PytLab self-assigned this Dec 24, 2018
@wulidongdong
Copy link
Author

image
比较简单,我只需要decimal_individual的功能,但是需要一个额外的参数在计算fitness时传入。
现在我已经解决了,我把这个参数在计算fitness时另外传入了。
但是我还是想问如果遇到这种需要额外参数时应该怎么解决,感谢。

@PytLab
Copy link
Owner

PytLab commented Dec 24, 2018

这个可以解决,我会在后续的更新中通过添加kwargs尝试解决这个问题,多谢

@PytLab PytLab added the todo label Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants