protected override void ApplyGenom(GeneticGame.Genom genom)
    {
        maxDegreeX      = genom.GetGen("max_degree_x").value;
        forcePowerLeft  = genom.GetGen("force_power_left").value;
        forcePowerRight = genom.GetGen("force_power_right").value;

        rig = GetComponent <Rigidbody>();

        forcePoint = transform.Find("ForcePoint");

        forcePointMat = forcePoint.gameObject.GetComponent <Renderer>().material;

        StartCoroutine(AddRandomForce(genom.GetGen("force_power_left").maxVal));
    }
Beispiel #2
0
        //public Genom(Dictionary<string, Gen> gens_dict)
        //{
        //    this.gens_dict = new Dictionary<string, Gen>(gens_dict);
        //}

        public Genom(Genom parent)
        {
            for (int j = 0; j < parent.Size(); j++)
            {
                Gen pGen = parent.GetGen(j);
                AddGen(new Gen(pGen)); //copy
            }

            //this.gens_dict = new Dictionary<string, Gen>(copy.gens_dict);
        }
Beispiel #3
0
    protected override void ApplyGenom(GeneticGame.Genom genom)
    {
        maxDegreeXLeft  = genom.GetGen("max_degree_x_left").value;
        maxDegreeXRight = genom.GetGen("max_degree_x_right").value;

        forcePowerLeft  = genom.GetGen("force_power_left").value;
        forcePowerRight = genom.GetGen("force_power_right").value;

        wheelRadius = genom.GetGen("wheel_radius").value;

        rig = GetComponent <Rigidbody>();

        forcePoint = transform.Find("ForcePoint");

        forcePointMat = forcePoint.gameObject.GetComponent <Renderer>().material;

        wheel = transform.Find("wheels/Wheel").gameObject;

        wheel.transform.localScale    *= wheelRadius;
        wheel.transform.localPosition *= wheelRadius / 2;

        StartCoroutine(AddRandomForce(genom.GetGen("force_power_left").maxVal));
    }