public float GetTorque(float angle, float distance)
    {
        IDictionary <int, IList <FuzzyValue <IInputFuzzyMember> > > fuzzified;
        IList <FuzzyValue <IResultFuzzyMember> > evaluated;
        var result = fls.Evaluate(new Dictionary <int, float>
        {
            { this.angle.Category, angle },
            { this.distance.Category, distance }
        }, out fuzzified, out evaluated);

        //Debug.Log("------------------Right------------------");
        //Debug.Log("------------------[Angle]------------------");
        //foreach (var fuz in fuzzified[1])
        //{
        //    Debug.Log("------------------ " + fuz.FuzzyMember.Name + " : " + fuz.Degree + "------------------ ");
        //}

        //Debug.Log("[Distance]");
        //foreach (var fuz in fuzzified[2])
        //{
        //    Debug.Log("------------------ " + fuz.FuzzyMember.Name + " : " + fuz.Degree + "------------------ ");
        //}

        //Debug.Log("[Result]");
        //foreach (var fuz in evaluated)
        //{
        //    Debug.Log(fuz.FuzzyMember.Name + " : " + fuz.Degree);
        //}

        return(result);
    }
예제 #2
0
        public float GetTorque(float angle, float distance)
        {
            IDictionary <int, IList <FuzzyValue <IInputFuzzyMember> > > fuzzified;
            IList <FuzzyValue <IResultFuzzyMember> > evaluated;
            var result = fls.Evaluate(new Dictionary <int, float>
            {
                { this.angle.Category, angle },
                { this.distance.Category, distance }
            }, out fuzzified, out evaluated);

            return(result);
        }
        public float GetPriority(float sShoot, float sPass, float ballX, float ballY)
        {
            IDictionary <int, IList <FuzzyValue <IInputFuzzyMember> > > fuzzified;
            IList <FuzzyValue <IResultFuzzyMember> > evaluated;

            var result = fls.Evaluate(new Dictionary <int, float>
            {
                { this.Shoot.Category, sShoot },
                { this.Pass.Category, sPass },
                { this.BallX.Category, ballX },
                { this.BallY.Category, ballY }
            }, out fuzzified, out evaluated);

            return(result);
        }
예제 #4
0
        public float GetState(float orientation, float distanceDifference, float distanceGoal)
        {
            IDictionary <int, IList <FuzzyValue <IInputFuzzyMember> > > fuzzified;
            IList <FuzzyValue <IResultFuzzyMember> > evaluated;
            float result = 0;

            try {
                result = fls.Evaluate(new Dictionary <int, float>
                {
                    { this.orientation.Category, orientation },
                    { this.distanceDifference.Category, distanceDifference },
                    { this.distanceGoal.Category, distanceGoal }
                }, out fuzzified, out evaluated);
            } catch (Exception e)
            {
            }

            return(result);
        }