Skip to content

Commit a137a89

Browse files
Christoph BodensteinChristoph Bodenstein
authored andcommitted
childs -> children
1 parent fea0924 commit a137a89

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

TimeNETOptimizationEnvironment/src/toe/optimization/OptimizerGenetic.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,32 +333,32 @@ private ArrayList<SimulationType> MPCCrossOver(SimulationType parent1, Simulatio
333333
}
334334

335335
private ArrayList< ArrayList<SimulationType>> crossPopulation(ArrayList< ArrayList<SimulationType>> population, int numNewChildren) {
336-
ArrayList<SimulationType> childs = new ArrayList<>();
336+
ArrayList<SimulationType> children = new ArrayList<>();
337337
if (this.crossOverStrategy == typeOfGeneticCrossover.OnePoint) {
338338
for (int i = 0; i < numNewChildren; ++i) {
339339
int indexOfFather = randomGenerator.nextInt(populationSize);
340340
int indexOfMother = randomGenerator.nextInt(populationSize);
341341

342-
childs = onePointCrossOver(population.get(indexOfFather).get(0), population.get(indexOfMother).get(0));
342+
children = onePointCrossOver(population.get(indexOfFather).get(0), population.get(indexOfMother).get(0));
343343
}
344344
} else if (this.crossOverStrategy == typeOfGeneticCrossover.SBX) {
345345
for (int i = 0; i < numNewChildren; ++i) {
346346
int indexOfFather = randomGenerator.nextInt(populationSize);
347347
int indexOfMother = randomGenerator.nextInt(populationSize);
348348

349-
childs = SBXCrossOver(population.get(indexOfFather).get(0), population.get(indexOfMother).get(0));
349+
children = SBXCrossOver(population.get(indexOfFather).get(0), population.get(indexOfMother).get(0));
350350
}
351351
} else if (this.crossOverStrategy == typeOfGeneticCrossover.MPC) {
352352
for (int i = 0; i < population.size(); i += 3) {
353353
if (randomGenerator.nextDouble() <= MPC_cr && population.size() > i + 2) {
354-
childs = MPCCrossOver(population.get(i).get(0), population.get(i + 1).get(0), population.get(i + 2).get(0));
354+
children = MPCCrossOver(population.get(i).get(0), population.get(i + 1).get(0), population.get(i + 2).get(0));
355355
}
356356
}
357357
} else {
358358
//TODO default handling
359359
}
360360

361-
for (SimulationType child : childs) {
361+
for (SimulationType child : children) {
362362
ArrayList<SimulationType> childList = new ArrayList<>();
363363
childList.add(child);
364364
population.add(childList);

0 commit comments

Comments
 (0)