Esempio n. 1
0
    public override void _Ready()
    {
        rf = (RocketFactory)GetChild(0);
        of = (ObstacleFactory)GetChild(1);
        tf = (TargetFactory)GetChild(2);

        rockets            = rf.createPopulation(References.populationSize);
        obstacles          = of.createPopulation(References.obstaclePopulationSize);
        target             = tf.createTarget();
        populationDead     = false;
        time               = 0;
        maxFitnessAchieved = 0;

        for (int i = 0; i < rockets.Length; i++)
        {
            rockets[i].SetTarget(target);
        }

        genePool       = new List <Instruction[]>();
        fitnessHistory = new List <string>();

        infoText = (RichTextLabel)GetNode("/root/MainScene/UI/InfoText");
    }