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

Run code after GA completes #23

Open
blonkm opened this issue Feb 17, 2022 · 3 comments
Open

Run code after GA completes #23

blonkm opened this issue Feb 17, 2022 · 3 comments

Comments

@blonkm
Copy link

blonkm commented Feb 17, 2022

How will I run code after the GA completes? Notification runs n times, I want code to run only once after the solution is found (or if not found just show "could not solve").

@blonkm
Copy link
Author

blonkm commented Apr 20, 2023

I solved my own issue by modifying the for loop using setTimeout, so the UI gets time to respond to events. If you like I can make a fork to show my code (haven't done that yet).

@subprotocol
Copy link
Owner

You should be able to check the value of isFinished:

function(pop, generation, stats, isFinished)

It would be nice if returning false would stop it from running (if you found a solution). Is this similar to what you accomplished with setTimeout? I would be happy to take look so I understand your use case more.

@blonkm
Copy link
Author

blonkm commented May 23, 2023

https://github.com/blonkm/schedule is my repo
issue here: blonkm/schedule#1

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

No branches or pull requests

2 participants