Esempio n. 1
0
        public Evolution(Cart cart)
        {
            this.cart = cart;
            evolutionManager = new GestoreRN_NEAT(5, 1, Const.INITIAL_POPULATION);

            int j=0;
            vectorGenotipo=new GenotipoRN[evolutionManager.population.Count];
            foreach (GenotipoRN g in evolutionManager.population)
            {
                vectorGenotipo[j] = g;
                j++;
            }

            ReadyFenotipo += new SetFenotipo(cart.SetFenotipo);
            cart.ReturnFitnessEvent += new Cart.ReturnFitness(finishedSimulation);

            genotipoInTest = evolutionManager.GetGenotipo();
            ReadyFenotipo(new FenotipoRN(genotipoInTest));
        }
Esempio n. 2
0
        protected override void Initialize()
        {
            cartSize = new Vector2(2, 1);
            cartPos = new Vector2(Const.ScreenWidth/(2*Const.Zoom), Const.FloorYPosition - cartSize.Y / 2);

            pole1Size = new Vector2(0.1f, 0.9f);
            pole2Size = new Vector2(0.1f, 0.5f);

            cartObject = new Cart(cartPos, cartSize, pole1Size, pole2Size);
            evolution = new Evolution(cartObject);
            rectTexture = DrawingHelper.RectangularTexture(graphics.GraphicsDevice, 1000, 1000, Color.White);

            base.Initialize();
        }