Beispiel #1
0
 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;
 }
Beispiel #2
0
        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);
             * }
             */
        }
Beispiel #3
0
 public HillClimbingSolver(TSPVisualizer visualizer)
 {
     this.visualizer = visualizer;
 }