Switch from inheritance to composition
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import domain.annealing.SimulatedAnnealing;
|
||||
import domain.ant_colony.AntColonyOptimization;
|
||||
import domain.binary.algorithm.AbstractGeneticAlgorithm;
|
||||
import domain.binary.algorithm.AlgorithmEngine;
|
||||
import domain.binary.algorithm.CustomGeneticAlgorithm;
|
||||
import domain.binary.algorithm.SimpleGeneticAlgorithm;
|
||||
|
||||
@@ -19,7 +21,7 @@ public class Main {
|
||||
System.out.println("Optimized distance for travel: " + SimulatedAnnealing.simulateAnnealing(10, 10000, 0.9995));
|
||||
break;
|
||||
case 2:
|
||||
SimpleGeneticAlgorithm ga = new SimpleGeneticAlgorithm(
|
||||
AbstractGeneticAlgorithm ga = new SimpleGeneticAlgorithm(
|
||||
15,
|
||||
0.5,
|
||||
0.025,
|
||||
@@ -27,7 +29,7 @@ public class Main {
|
||||
true,
|
||||
"1011000100000100010000100000100111001000000100000100000000001111"
|
||||
);
|
||||
ga.launch();
|
||||
AlgorithmEngine.start(ga);
|
||||
break;
|
||||
case 3:
|
||||
AntColonyOptimization antColony = new AntColonyOptimization(21);
|
||||
|
||||
Reference in New Issue
Block a user