// Use this for initialization void Start() { times = new List <float>(); text.text = "Generation " + currentGeneration; //Model.parameters = new float[] { alpha, beta, gamma, zeta, eta, kappa, nu, tau }; BuildModel(); GameObject newSpawn = Instantiate(spawn); LadyBug brain = newSpawn.GetComponent <LadyBug>(); brain.AcceptModel(model); startTime = Time.time; }
public void NextGeneration(Model m) { m.ForceTimeOut(); times.Add(Time.time - startTime); times.Sort(); currentGeneration++; text.text = "Generation " + currentGeneration + "\nFastest Time: " + times[0] + "\nFound food: " + timesFoundFood; model = m; GameObject newSpawn = Instantiate(spawn); LadyBug brain = newSpawn.GetComponent <LadyBug>(); brain.AcceptModel(m); brain.generationID = currentGeneration; startTime = Time.time; }