Chrispresso / SnakeAI

MIT License
245 stars 75 forks source link

Intermitent visualisation #7

Open guillebot opened 4 years ago

guillebot commented 4 years ago

What would be extremely good in order to use this for teaching, would be a mode in which it trains without visualisation and only shows some of the runs of each generation.

If you have any pointers about how you would do this, I'd gladly send some pr.

thanks

Chrispresso commented 4 years ago

You can take a look at https://github.com/Chrispresso/SuperMarioBros-AI/blob/master/smb_ai.py. I do something similar there. I used CTRL+V to enable/disable visualization. The same could be done for this case. The only problem with it is if you go based off the clock for the paint event, you are restricted to the refresh rate of the monitor. This is why I was doing training through command line, so i could minimize training time. If you wanted to enable/disable you might be able to set the FPS during this part as well.