Skip to content

Commit 8f265c7

Browse files
committed
updated
1 parent 2e88332 commit 8f265c7

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

commons-math-examples/examples-ga/examples-ga-tsp/src/main/java/org/apache/commons/math4/examples/ga/tsp/legacy/TSPOptimizerLegacy.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,16 @@
4141
public class TSPOptimizerLegacy {
4242

4343
/**
44-
* Main method to initiate optimization.
44+
* MainThread.sleep(5000) method to initiate optimization.
4545
* @param args arguments
4646
*/
4747
public static void main(String[] args) {
48-
try {
49-
final Population initPopulation = getInitialPopulation(Constants.CITIES);
5048

51-
final TSPOptimizerLegacy optimizer = new TSPOptimizerLegacy();
49+
final Population initPopulation = getInitialPopulation(Constants.CITIES);
50+
final TSPOptimizerLegacy optimizer = new TSPOptimizerLegacy();
5251

53-
optimizer.optimize(initPopulation, Constants.CITIES);
52+
optimizer.optimize(initPopulation, Constants.CITIES);
5453

55-
Thread.sleep(5000);
56-
57-
} catch (InterruptedException e) {
58-
throw new GeneticException(e);
59-
}
6054
}
6155

6256
/**

commons-math-ga/src/test/java/org/apache/commons/math4/ga/GeneticAlgorithmTestBinary.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public void reset()
6969

7070
@Test
7171
public void test() {
72-
// to test a stochastic algorithm is hard, so this will rather be an usage
73-
// example
7472

7573
// initialize a new genetic algorithm
7674
GeneticAlgorithm<List<Integer>> ga = new GeneticAlgorithm<>(new OnePointCrossover<Integer, List<Integer>>(),

0 commit comments

Comments
 (0)