Пример #1
0
 private void Window_Loaded_1(object sender, RoutedEventArgs e)
 {
     DisplayPlant display = new DisplayPlant(CanvasOutput);
     display.Universe = new PlantUniverse();
     display.Universe.Reset();
     //display.Paint(CanvasOutput);
 }
Пример #2
0
        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            DisplayPlant display = new DisplayPlant(CanvasOutput);

            display.Universe = new PlantUniverse();
            display.Universe.Reset();
            //display.Paint(CanvasOutput);
        }
Пример #3
0
 private void Init()
 {
     _display = new DisplayPlant(CanvasOutput);
 }
Пример #4
0
        private void Window_Loaded_1(object sender, RoutedEventArgs e)
        {
            pop = InitPopulation();
            score = new PlantScore();
            this.genetic = new BasicEA(pop, score);

            //this.genetic.Speciation = new ArraySpeciation<DoubleArrayGenome>();

            genetic.AddOperation(0.9, new Splice(PlantUniverse.GenomeSize / 3));
            genetic.AddOperation(0.1, new MutatePerturb(0.1));

            // Display

            this.universe = new PlantUniverse();
            this.universe.Reset();


            DoubleArrayGenome bestGenome = (DoubleArrayGenome)genetic.BestGenome;
            PlantPhysics physics = new PlantPhysics();
            PlantGrowth growth = new PlantGrowth();

            for (int i = 0; i < 100; i++)
            {
                physics.RunPhysics(universe);
                growth.RunGrowth(universe, bestGenome.Data);
            }

            this.display = new DisplayPlant(CanvasOutput);
            this.display.Universe = this.universe;
            Thread t = new Thread(DoWork);
            t.Start();
        }