ai.js
changeset 99 df4736e659f2
parent 74 93cb48b73b39
child 104 47d42234dd5c
--- a/ai.js	Sat Sep 20 09:44:08 2014 +0300
+++ b/ai.js	Sat Sep 20 22:55:24 2014 +0300
@@ -153,7 +153,7 @@
 
 /**
  * Defines coefficient for linear resulted weight function.
- * @name ai.OneStepDeep.cfg
+ * @name ai.OneStepAhead.cfg
  * @namespace
  * @property {number} scoreCoef    multiplicator for score
  * @property {number} maxValCoef   multiplicator for max value
@@ -164,15 +164,15 @@
 
 /** 1 step deep with * AI.
  * @param {Board} brdEngine  board engine from board.js
- * @param {ai.OneStepDeep.cfg} cfg  configuration settings
+ * @param {ai.OneStepAhead.cfg} cfg  configuration settings
  * @constructor */
-ai.OneStepDeep = function(brdEngine, cfg) {
+ai.OneStepAhead = function(brdEngine, cfg) {
     this.brdEngine = brdEngine;
-    this.cfg = ai.copyObj(ai.OneStepDeep.bestCfg);
+    this.cfg = ai.copyObj(ai.OneStepAhead.bestCfg);
     ai.copyObj(cfg, this.cfg);
 }
-ai.OneStepDeep.bestCfg = {scoreCoef: 1, maxValCoef: 0, cornerBonus: 0, edgeBonus: 0, freeBonus: 0};
-ai.OneStepDeep.prototype.weight = function(brd) {
+ai.OneStepAhead.bestCfg = {scoreCoef: 1, maxValCoef: 0, cornerBonus: 0, edgeBonus: 0, freeBonus: 0};
+ai.OneStepAhead.prototype.weight = function(brd) {
     var weight = 0;
     if (this.cfg.scoreCoef > 0)
         weight += this.cfg.scoreCoef * brd.score();
@@ -187,7 +187,7 @@
         weight += this.cfg.freeBonus * brd.free();
     return weight;
 }
-ai.OneStepDeep.prototype.analyse = function(brd) {
+ai.OneStepAhead.prototype.analyse = function(brd) {
     var origBrd = new this.brdEngine(brd);
     var nextBrd = new this.brdEngine();
     var maxWeight = -1;
@@ -205,7 +205,7 @@
     return bestDir;
 }
 /* Mark that next board will be unrelated to previous, so any stored precompution can be cleared. */
-ai.OneStepDeep.prototype.cleanup = function() { }
+ai.OneStepAhead.prototype.cleanup = function() { }