From 2c9e62f1b67473d467453f6cf001976289ff9fdf Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 31 Jul 2018 11:15:46 +0200 Subject: [PATCH] Genetic Rules Refactored to Genes --- Root.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Root.js b/Root.js index 86a911235..2e689d2a0 100644 --- a/Root.js +++ b/Root.js @@ -759,19 +759,19 @@ exports.newRoot = function newRoot() { if (FULL_LOG === true) { console.log(logDisplace + "[INFO] start -> findProcess -> runTradingBot -> Entering function."); } - if (pBotConfig.geneticRules !== undefined) { + if (pBotConfig.genes !== undefined) { - /* Here, based on the genetic rules we will create one instance for each combination of genes */ + /* Here, based on the gene we will create one instance for each combination of genes */ let valueMatrix = []; - for (let i = 0; i < pBotConfig.geneticRules.length; i++) { + for (let i = 0; i < pBotConfig.genes.length; i++) { - let rule = pBotConfig.geneticRules[i]; + let gene = pBotConfig.genes[i]; let possibleValues = []; - for (let j = rule.lowerLimit; j <= rule.upperLimit; j++) { + for (let j = gene.lowerLimit; j <= gene.upperLimit; j++) { possibleValues.push(j); @@ -824,9 +824,9 @@ exports.newRoot = function newRoot() { let genes = {}; let clonKey = ""; - for (let j = 0; j < botConfig.geneticRules.length; j++) { + for (let j = 0; j < botConfig.genes.length; j++) { - genes[botConfig.geneticRules[j].name] = combination[j]; + genes[botConfig.genes[j].name] = combination[j]; clonKey = clonKey + "." + combination[j]; } @@ -848,7 +848,7 @@ exports.newRoot = function newRoot() { } } else { - /* If the bot does not have any genetic rules at all */ + /* If the bot does not have any genes at all */ let genes = {}; pBotConfig.instance = "Master";