Example #1
0
    protected override void EndGeneration()
    {
        Generation currentGeneration = generations.Last.Value;

        foreach (GameObject box in boxes)
        {
            currentGeneration.AddPhenotype(getGenesFromBox(box), getBoxFitness(box));
        }

        base.EndGeneration();
    }
Example #2
0
    protected override void EndGeneration()
    {
        Generation currentGeneration = generations.Last.Value;

        foreach (GameObject critter in critters)
        {
            CritterCtrl       ctrl = critter.GetComponent <CritterCtrl>();
            CritterANNControl ann  = critter.GetComponent <CritterANNControl>();
            currentGeneration.AddPhenotype(ann.neuralNetwork.ws, ctrl.LifeSpan() - ctrl.naturalLifeSpan());
        }

        base.EndGeneration();
    }