saltbot-org / saltbot

automated virtual betting bot
GNU General Public License v2.0
53 stars 45 forks source link

"Update Genetic Weights" Causing lockup #139

Closed calexil closed 7 years ago

calexil commented 7 years ago

From what I can tell, this button does not function correctly on lower end machines. The popup just hangs, and there is no indication that any updates are being applied.

How would one check that the update is running, and why doesn't it just happen automatically?

reconman commented 7 years ago

The default behaviour of high performance tasks in javascript is that it runs on one single thread. As long as that thread is running the GUI won't react.

When you start programming GUIs the first thing you experience is that lockup. The solution is to create a background thread where the calculations are run.

In Chrome creating a background thread is not as easy as it seems. The thread needs to be supplied everything and won't be able to interact with chrome.local.storage or variables of other scripts at all.

About a year ago I tried moving the mutation calculations to another thread but because of the above mentioned difficulties I put it on hold.

calexil commented 7 years ago

hmm okay, well I'll leave this open until a solution is reached I guess

calexil commented 7 years ago

Wouldn't it be more elegant to have the bot update periodically like every 10 matches or so but only for the first 50 matches or whatever makes sense

and then we just have a button that resets the chromo pool only

reconman commented 7 years ago

That would mess up the chromosome badly. It would just optimize for 50 matches it recorded and ignore the rest. Every 10 matches would be quite often so there is a high chance of the chromosome being manipulated.

calexil commented 7 years ago

hmm.

calexil commented 7 years ago

no solution presented, closing

calexil commented 7 years ago

This issue was reported errantly, closing

reconman commented 7 years ago

I don't think so and I want to keep this issue open because I may be able to refactor the genetic weight calculations to web workers in the future.