示例#1
0
    // FixedUpdate is called every 0.02s
    void FixedUpdate()
    {
        net.Update();
        SetAngles(net.GetOutputs());

        /*
         * if (gen_alg.gen_ind > 120) {
         *      gen_alg = new GenAlg ();
         *      run++;
         * }
         *
         * //Conditions for terminating current chrom simulation
         * counter += Time.deltaTime;
         * if (counter > 40) {
         *      GoToNextChrom ();
         * } else if (body.transform.position.y < 1.5) {
         *      GoToNextChrom ();
         * } else if (Mathf.Abs (body.transform.rotation.x) > 100) {
         *      GoToNextChrom ();
         * } else if (float.IsNaN (body.transform.position.x)) {
         *      GoToNextChrom ();
         * }
         */
        //Debugging
        //System.IO.File.AppendAllText("C:/UnityLogs/logRNN.txt", net.GetOutputs ()[0]+" "+net.GetOutputs ()[1]+" "+net.GetOutputs ()[2]+" "+net.GetOutputs ()[3]+" "+net.GetOutputs ()[4]+" "+net.GetOutputs ()[5]+"\n");
        //Debug.Log ("net outputs: "+net.GetOutputs ()[0]+" "+net.GetOutputs ()[1]+" "+net.GetOutputs ()[2]+" "+net.GetOutputs ()[3]+" "+net.GetOutputs ()[4]+" "+net.GetOutputs ()[5]);

        //System.IO.File.AppendAllText("C:/UnityLogs/logRNN.txt", net.GetActivities ()[0]+" "+net.GetActivities ()[1]+" "+net.GetActivities ()[2]+" "+net.GetActivities ()[3]+" "+net.GetActivities ()[4]+" "+net.GetActivities ()[5]+"\n");
        //Debug.Log ("net activities: "+net.GetActivities ()[0]+" "+net.GetActivities ()[1]+" "+net.GetActivities ()[2]+" "+net.GetActivities ()[3]+" "+net.GetActivities ()[4]+" "+net.GetActivities ()[5]);
    }