You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2022/02/07 02:21:43 UTC
[commons-math] branch feature__MATH-1563__genetic_algorithm updated: Accept usage of "System.out" in examples.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch feature__MATH-1563__genetic_algorithm
in repository https://gitbox.apache.org/repos/asf/commons-math.git
The following commit(s) were added to refs/heads/feature__MATH-1563__genetic_algorithm by this push:
new 0d6c6e6 Accept usage of "System.out" in examples.
0d6c6e6 is described below
commit 0d6c6e60f4f840f0798d5d98579c3b9c9ffac830
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Mon Feb 7 03:21:06 2022 +0100
Accept usage of "System.out" in examples.
---
.../examples/ga/mathfunctions/legacy/LegacyMathFunctionOptimizer.java | 2 ++
.../apache/commons/math4/examples/ga/tsp/legacy/LegacyTSPOptimizer.java | 2 ++
2 files changed, 4 insertions(+)
diff --git a/commons-math-examples/examples-ga/examples-ga-math-functions-legacy/src/main/java/org/apache/commons/math4/examples/ga/mathfunctions/legacy/LegacyMathFunctionOptimizer.java b/commons-math-examples/examples-ga/examples-ga-math-functions-legacy/src/main/java/org/apache/commons/math4/examples/ga/mathfunctions/legacy/LegacyMathFunctionOptimizer.java
index cdc281c..ca49162 100644
--- a/commons-math-examples/examples-ga/examples-ga-math-functions-legacy/src/main/java/org/apache/commons/math4/examples/ga/mathfunctions/legacy/LegacyMathFunctionOptimizer.java
+++ b/commons-math-examples/examples-ga/examples-ga-math-functions-legacy/src/main/java/org/apache/commons/math4/examples/ga/mathfunctions/legacy/LegacyMathFunctionOptimizer.java
@@ -67,7 +67,9 @@ public final class LegacyMathFunctionOptimizer {
// best chromosome from the final population
final Chromosome bestFinal = finalPopulation.getFittestChromosome();
+ //CHECKSTYLE: stop all
System.out.println("best=" + bestFinal.toString());
+ //CHECKSTYLE: resume all
}
private static Population getInitialPopulation(int dimension, int populationSize, double elitismRate) {
diff --git a/commons-math-examples/examples-ga/examples-ga-tsp-legacy/src/main/java/org/apache/commons/math4/examples/ga/tsp/legacy/LegacyTSPOptimizer.java b/commons-math-examples/examples-ga/examples-ga-tsp-legacy/src/main/java/org/apache/commons/math4/examples/ga/tsp/legacy/LegacyTSPOptimizer.java
index efe765b..0f005f6 100644
--- a/commons-math-examples/examples-ga/examples-ga-tsp-legacy/src/main/java/org/apache/commons/math4/examples/ga/tsp/legacy/LegacyTSPOptimizer.java
+++ b/commons-math-examples/examples-ga/examples-ga-tsp-legacy/src/main/java/org/apache/commons/math4/examples/ga/tsp/legacy/LegacyTSPOptimizer.java
@@ -66,7 +66,9 @@ public class LegacyTSPOptimizer {
@SuppressWarnings("unchecked")
final RandomKey<City> bestFinal = (RandomKey<City>) finalPopulation.getFittestChromosome();
+ //CHECKSTYLE: stop all
System.out.println("best=" + bestFinal.toString());
+ //CHECKSTYLE: resume all
}
private static Population getInitialPopulation(List<City> cities, int populationSize, double elitismRate) {