public GeneticAlgorightm(TSPVisualizer visualizer) { population = new List <TSPSolution>(PopulationSize); bestSelector = new RouletteWheelSelector(rnd, Fitness); worstSelector = new RouletteWheelSelector(rnd, s => 1 / Fitness(s)); this.visualizer = visualizer; }
public Form1() { InitializeComponent(); vis = new TSPVisualizer(pictureBox1); /* * int size = 3, count = 1; * * List<int> permutation = new List<int>(); * for (int i = 0; i < size; i++) * { * permutation.Add(i + 1); * } * * while (permutation != null) * { * count++; * TreeSolver.changeToNextPermutation(permutation); * } */ }
public HillClimbingSolver(TSPVisualizer visualizer) { this.visualizer = visualizer; }