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

Added support for async fitness function using Promises #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

richardklafter
Copy link

Minimal changes to support async fitness fitness functions with promises.

@zinefer
Copy link

zinefer commented Jan 16, 2018

Does this run my fitness functions in parallel? How could I check something like that...

@richardklafter
Copy link
Author

It runs all the fitness functions from one generation in parallel. If your fitness function is 100% JS this will not speed anything up but if your fitness function makes network calls or preforms some other async operation they will all be done in parallel.

I used it for tuning the parameters of an AI I built to play a game. In that case, running my fitness function took ~3min and I did it on lots of remote servers.

@zinefer
Copy link

zinefer commented Jan 16, 2018

Yeah, I came to that realization a bit later last night. My fitness function is just javascript that will require some engineering to get to run asynchronously. Thanks for your help.

@Glavin001
Copy link

For those looking for async support, I've forked this repo and rewrote it in TypeScript and added support for async fitness method (including unit tests): https://github.com/Glavin001/genetic-js
Hope this helps you, too! 😃

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

Successfully merging this pull request may close these issues.

3 participants