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 /** @{link ai.BlindWeightRandom.cfg} |
|
80 @namespace */ |
|
81 ai.BlindWeightRandom.bestCfg = { left: 1, down: 10, right: 5, up: 1 }; |
79 ai.BlindWeightRandom.bestCfg = { left: 1, down: 10, right: 5, up: 1 }; |
82 ai.BlindWeightRandom.prototype.analyse = function(brd) { |
80 ai.BlindWeightRandom.prototype.analyse = function(brd) { |
83 var origBrd = new this.brdEngine(brd); |
81 var origBrd = new this.brdEngine(brd); |
84 while (true) { |
82 while (true) { |
85 var rnd = Math.random(); |
83 var rnd = Math.random(); |