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

A way to pause/resume network.evolve() #194

Open
tracycollins opened this issue Dec 5, 2019 · 4 comments
Open

A way to pause/resume network.evolve() #194

tracycollins opened this issue Dec 5, 2019 · 4 comments
Labels
🙌 community By or for the library's community ✨ enhancement Something could be better

Comments

@tracycollins
Copy link

When evolving a network on a machine, and using close to 100% of cpu capacity, it would be nice to have a way to pause and later resume the evolve() function. Otherwise, a machine can become unresponsive for other tasks.

Not sure how best to do this, or even if this functionality should/could exist in carrot. Is there a way to do this cleanly via node? pm2?

@christianechevarria
Copy link
Member

christianechevarria commented Dec 6, 2019

I think this is a very interesting idea that makes sense, off the top of my head I'd imagine that supporting a CLI listening for a keyboard interrupt or something could work but I'd have to look into how to go about it. @GavinRay97 would you have any ideas about how something like this could work?

@christianechevarria christianechevarria added ✨ enhancement Something could be better 🙌 community By or for the library's community labels Dec 6, 2019
@GavinRay97
Copy link

You could wrap the evolve() loop in an if(shouldContinue) or while(shouldContinue), and then set up a toggle on shouldContinue that can be triggered in the browser by invoking it through the console or programmatically (whether that be UI or otherwise), and in the CLI by intercepting keypress on some key to trigger it

@GavinRay97
Copy link

Actually, paused is probably a more idiomatic name, and you can throw it on the global namespace under carrot.paused.

if (!carrot.paused) {}

@christianechevarria
Copy link
Member

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙌 community By or for the library's community ✨ enhancement Something could be better
Projects
None yet
Development

No branches or pull requests

3 participants