sylvinus / chessathome

Chess@home
http://chessathome.org/
56 stars 5 forks source link

Add more randomness #29

Open sylvinus opened 13 years ago

sylvinus commented 13 years ago

So that the AI doesn't always play the same moves/openings

tbrowder commented 13 years ago

Where is the current entry point for randomness?

sylvinus commented 13 years ago

currently there's none! Besides using an opening book I'm not sure where to add it. Do you have any ideas?

tbrowder commented 13 years ago

Yes, but I'm just getting here today for the first time after seeing the interesting article about the project and thought there was already a random number feature somewhere. I have used the Mersenne Twister (when it was first released to the public) in a Monte Carlo project that required repeatability but in many independent random number streams. I generated some 300 generators, each with a starting seed randomly selected. That could be extended greatly and random numbers pre-generated on a server. For the scale you envision this may not work, but the huge random number domain of the Mersenne Twister could help. The code is open source and a Javascript version could be made easily if there is not one available already. Perhaps each node could get a random seed from the master and then create its own independent stream-something like that.

tbrowder commented 13 years ago

I'm probably jumping in here too early as I re-read the problem. An opening set of moves could be defined with weights according to relative historical success. Then one is selected based on a random number generated by the node's host.