From 07e4b007564f03c7636c4ae09bf2c5bca3693b42 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 31 Jul 2018 11:15:38 +0200 Subject: [PATCH] Genetic Rules Refactored to Genes --- Server/ConfigReader.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Server/ConfigReader.js b/Server/ConfigReader.js index 628501b9d..149506cd8 100644 --- a/Server/ConfigReader.js +++ b/Server/ConfigReader.js @@ -365,19 +365,19 @@ /* Here we will add all the possible Clones of this bot */ - if (configObj.geneticRules !== undefined) { + if (configObj.genes !== undefined) { - /* Here, based on the genetic rules we will create one instance for each combination of genes */ + /* Here, based on the genes we will create one instance for each combination of genes */ let valueMatrix = []; - for (let i = 0; i < configObj.geneticRules.length; i++) { + for (let i = 0; i < configObj.genes.length; i++) { - let rule = configObj.geneticRules[i]; + let gene = configObj.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); @@ -434,9 +434,9 @@ 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]; } @@ -468,7 +468,7 @@ } } else { - /* If the bot does not have any genetic rules at all we do what we did before clones existed */ + /* If the bot does not have any genes at all we do what we did before clones existed */ devTeam.bots[j] = configObj;