コード例 #1
0
ファイル: SnyderStart.cs プロジェクト: Patiun/LadyBug
    // 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;
    }
コード例 #2
0
ファイル: SnyderStart.cs プロジェクト: Patiun/LadyBug
    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;
    }