예제 #1
0
 //Init population
 public void Init(int populationSize)
 {
     for (int i = 0; i < populationSize; i++)
     {
         PopulationInd ind = CreateIndividual(i);
         ListOfPopulation.Add(ind);
     }
 }
예제 #2
0
    //set up and return a fresh population individual
    private PopulationInd CreateIndividual(int i)
    {
        PopulationInd ind = Instantiate(populationInd, transform.position, transform.rotation);

        //organize in UNITY ide catalogized for inspection
        ind.transform.SetParent(parentGO);
        ind.InitIndividual(i);
        return(ind);
    }