示例#1
0
    IEnumerator Coordinate()
    {
        GeneticOperationsComponent.SetPopulationDNA(PopulationComponent.GetPopulationDNA());
        List <List <List <Vector3> > > DnaFromNextGen = new List <List <List <Vector3> > >();

        while (!ReadyToGo())
        {
            yield return(null);
        }
        StartSimulation();
        EvalComponent.SetHeadPositionY(PopulationComponent.GetHeadPositionY());
        EvalComponent.SetFootPositionY(PopulationComponent.GetFootPositionY());

        while (!EvalComponent.done)
        {
            yield return(new WaitForSeconds(0.5f));
        }
        ReplUtils.SaveSimmulation(PopulationComponent.GetPopulationDNA(), EvalComponent.GetFitnessList(), simcounter);

        GeneticOperationsComponent.ComputeNextGeneration(EvalComponent.GetFitnessList(), out DnaFromNextGen);
        PopulationComponent.SetDNA(DnaFromNextGen);
        ResetState();
        simcounter++;
    }