예제 #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;
 }
예제 #2
0
파일: Form1.cs 프로젝트: vvancak/ai
        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);
             * }
             */
        }
예제 #3
0
 public HillClimbingSolver(TSPVisualizer visualizer)
 {
     this.visualizer = visualizer;
 }