Set better coefficient for blind-weight-random AI.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 20 Sep 2014 23:56:02 +0300
changeset 104 47d42234dd5c
parent 103 54dfc3b4e7d3
child 105 6a0997efaa53
Set better coefficient for blind-weight-random AI.
2048.html
ai.js
--- a/2048.html	Sat Sep 20 23:47:48 2014 +0300
+++ b/2048.html	Sat Sep 20 23:56:02 2014 +0300
@@ -194,13 +194,13 @@
           <input type="text" name="left" class="positive" pattern="[0-9]*[.]?[0-9]*" value="1"/> left weight
         </div>
         <div class="option">
-          <input type="text" name="right" class="positive" pattern="[0-9]*[.]?[0-9]*" value="1"/> right weight
+          <input type="text" name="right" class="positive" pattern="[0-9]*[.]?[0-9]*" value="16"/> right weight
         </div>
         <div class="option">
-          <input type="text" name="up" class="positive" pattern="[0-9]*[.]?[0-9]*" value="1"/> up weight
+          <input type="text" name="up" class="positive" pattern="[0-9]*[.]?[0-9]*" value="4"/> up weight
         </div>
         <div class="option">
-          <input type="text" name="down" class="positive" pattern="[0-9]*[.]?[0-9]*" value="1"/> down weight
+          <input type="text" name="down" class="positive" pattern="[0-9]*[.]?[0-9]*" value="8"/> down weight
         </div>
         <div class="clearfix"></div>
       </div>
--- a/ai.js	Sat Sep 20 23:47:48 2014 +0300
+++ b/ai.js	Sat Sep 20 23:56:02 2014 +0300
@@ -76,7 +76,7 @@
     this.threshold2 = (this.cfg.left + this.cfg.down)/total;
     this.threshold3 = (this.cfg.left + this.cfg.down + this.cfg.right)/total;
 }
-ai.BlindWeightRandom.bestCfg = { left: 1, down: 10, right: 5, up: 1 };
+ai.BlindWeightRandom.bestCfg = { left: 1, right: 16, up: 4, down: 8 };
 ai.BlindWeightRandom.prototype.analyse = function(brd) {
     var origBrd = new this.brdEngine(brd);
     while (true) {