equal
deleted
inserted
replaced
74 var total = this.cfg.left + this.cfg.right + this.cfg.up + this.cfg.down; |
74 var total = this.cfg.left + this.cfg.right + this.cfg.up + this.cfg.down; |
75 this.threshold1 = this.cfg.left/total; |
75 this.threshold1 = this.cfg.left/total; |
76 this.threshold2 = (this.cfg.left + this.cfg.down)/total; |
76 this.threshold2 = (this.cfg.left + this.cfg.down)/total; |
77 this.threshold3 = (this.cfg.left + this.cfg.down + this.cfg.right)/total; |
77 this.threshold3 = (this.cfg.left + this.cfg.down + this.cfg.right)/total; |
78 } |
78 } |
79 ai.BlindWeightRandom.bestCfg = { left: 1, down: 10, right: 5, up: 1 }; |
79 ai.BlindWeightRandom.bestCfg = { left: 1, right: 16, up: 4, down: 8 }; |
80 ai.BlindWeightRandom.prototype.analyse = function(brd) { |
80 ai.BlindWeightRandom.prototype.analyse = function(brd) { |
81 var origBrd = new this.brdEngine(brd); |
81 var origBrd = new this.brdEngine(brd); |
82 while (true) { |
82 while (true) { |
83 var rnd = Math.random(); |
83 var rnd = Math.random(); |
84 if (rnd < this.threshold1) |
84 if (rnd < this.threshold1) |