/// <summary>
        /// Default Constructor
        /// </summary>
        public FuzzyRenderer()
        {
            InitializeComponent(); //Always first!

            FuzzySets = new FuzzyCollection("", null); // THIS WAS CHANGED FROM THE ORIGINAL IMPLEMENTATION OF AN ARRAY (Restricting, painful nullchecks in foreach loops...) :TF
            Initialize();
        }
        /// <summary>
        /// Constructor: [name]
        /// </summary>
        /// <param name="setName">The Set Name</param>
        public FuzzyRenderer(string setName, FuzzyCollection fuzzySets)
        {
            InitializeComponent(); //Always....

            FuzzySets = fuzzySets;

            Initialize();

            SetName = setName;
        }
        /// <summary>
        /// Initialize and set up user-defined sets
        /// </summary>
        public override void InitializeController()
        {
            //initialize the collection
            ExampleSets = new FuzzyCollection("Example Sets", null);
            WorkingSets1 = new FuzzyCollection("Output Sets", null);
            WorkingSets2 = new FuzzyCollection("More Output", null);

            SetupExampleSet1();

            SetupExampleSet2();

            SetupWorkingSets();
        }
        /// <summary>
        /// Sets up the Throttle Fuzzy Sets for the Throttle FuzzyCollection
        /// </summary>
        private void SetThrottleSets()
        {
            #region Throttle Set Definition - T_None, T_Soft, T_Medium, T_Hard

                ThrottleSets = new FuzzyCollection("Throttle Sets", null);

                ThrottleSets.Add("T_None", new FuzzySet());
                ThrottleSets["T_None"] = new FuzzySet("T_None", 0, 100);
                ThrottleSets["T_None"].LineColour = new SolidBrush(Color.Gray);
                ThrottleSets["T_None"].AddPoint(0, 1, false, false);
                ThrottleSets["T_None"].AddPoint(8, 0, false, false);
                ThrottleSets["T_None"].AddPoint(100, 0, false, false);

                #endregion
        }
        /// <summary>
        /// Sets up the ThrottleOutput (Accumulator) Fuzzy Sets for the ThrottleOutput FuzzyCollection
        /// </summary>
        private void SetThrottleOutputSet()
        {
            ThrottleOutputs = new FuzzyCollection("Throttle Result", null);

                ThrottleOutputs.Add("ThrottleResult", new FuzzySet("ThrottleResult", 0, 100));
                ThrottleOutputs["ThrottleResult"].LineColour = new SolidBrush(Color.Black);
                ThrottleOutputs["ThrottleResult"].AddPoint(0, 0, false, false);
                ThrottleOutputs["ThrottleResult"].AddPoint(100, 0, false, false);
        }
        /// <summary>
        /// Generates empty, coloured sets for the rule-outputs to be Accumulated into
        /// 
        /// NOTE! Chane the NumRules int when you are adding more rules. Also look at:
        ///     AIController.ruleColours for a list of Colours that will be applied to the 
        ///     RuleSets
        /// 
        /// </summary>
        private void SetRuleSets()
        {
            //how many rules have been defined?
                int NumRules = 6;

                Dictionary<string, FuzzySet> rules = new Dictionary<string, FuzzySet>();

                for (int i = 0; i < NumRules; i++)
                {
                    rules.Add("Rule" + i.ToString(), new FuzzySet("Rule" + i.ToString(), 0, 100) { LineColour = ruleColours[i] });
                    rules["Rule" + i.ToString()].SetRangeWithPoints(0, 100);
                }

                RuleSets = new FuzzyCollection("Rules", rules);
        }
Example #7
0
        private VirtualKeyCode ToVK(string key)
        {
            VirtualKeyCode result;
            if(Enum.TryParse<VirtualKeyCode>(key, out result))
                return result;
            if(Aliases.TryGetValue(key.ToLowerInvariant(), out result))
                return result;

            FuzzyCollection<string> acceptedValues = new FuzzyCollection<string>(Metrics.LevenshteinDistance);
            foreach(var val in Enum.GetNames(typeof(VirtualKeyCode)).Concat(Aliases.Select(kv => kv.Key)).Select(a => a.ToUpperInvariant()))
            {
                acceptedValues.Add(val);
            }
            var closest = acceptedValues.GetClosest(key.ToUpperInvariant()).First();
            throw new InterpreterException(key + " is not a valid parameter, do you mean " + closest.Value + " ? (valid values are : \""+ Print(key, acceptedValues)+"\" )");
        }
Example #8
0
 private string Print(string startWith, FuzzyCollection<string> acceptedValues)
 {
     return String.Join(",", acceptedValues.Where(a=>a.StartsWith(startWith, StringComparison.InvariantCultureIgnoreCase)).ToArray());
 }
        /// <summary>
        /// Setup Y Velocity Sets
        /// </summary>
        private void SetupYVelocitySets()
        {
            YVelocitySets = new FuzzyCollection("YVelocity Sets", null)
            {
                new FuzzySet("Up Velocity", -50, 50) { LineColour = new SolidBrush(Color.Blue) },
                new FuzzySet("Safe Velocity", -50, 50) { LineColour = new SolidBrush(Color.Green) },
                new FuzzySet("Low Velocity", -50, 50) { LineColour = new SolidBrush(Color.Yellow) },
                new FuzzySet("Moderate Velocity", -50, 50) { LineColour = new SolidBrush(Color.Orange) },
                new FuzzySet("High Velocity", -50, 50) { LineColour = new SolidBrush(Color.Red) }
            };

            YVelocitySets["High Velocity"].AddPoint(50, 0, false, false);
            YVelocitySets["High Velocity"].AddPoint(-9, 0, false, false);
            YVelocitySets["High Velocity"].AddPoint(-12, 1, false, false);
            YVelocitySets["High Velocity"].AddPoint(-50, 1, false, false);

            YVelocitySets["Moderate Velocity"].AddPoint(50, 0, false, false);
            YVelocitySets["Moderate Velocity"].AddPoint(-6, 0, false, false);
            YVelocitySets["Moderate Velocity"].AddPoint(-8, 1, false, false);
            YVelocitySets["Moderate Velocity"].AddPoint(-10, 0, false, false);
            YVelocitySets["Moderate Velocity"].AddPoint(-50, 0, false, false);

            YVelocitySets["Low Velocity"].AddPoint(50, 0, false, false);
            YVelocitySets["Low Velocity"].AddPoint(-1, 0, false, false);
            YVelocitySets["Low Velocity"].AddPoint(-3, 1, false, false);
            YVelocitySets["Low Velocity"].AddPoint(-5, 1, false, false);
            YVelocitySets["Low Velocity"].AddPoint(-7, 0, false, false);
            YVelocitySets["Low Velocity"].AddPoint(-50, 0, false, false);

            YVelocitySets["Safe Velocity"].AddPoint(50, 0, false, false);
            YVelocitySets["Safe Velocity"].AddPoint(1, 0, false, false);
            YVelocitySets["Safe Velocity"].AddPoint(0, 1, false, false);
            YVelocitySets["Safe Velocity"].AddPoint(-1, 1, false, false);
            YVelocitySets["Safe Velocity"].AddPoint(-2, 0, false, false);
            YVelocitySets["Safe Velocity"].AddPoint(-50, 0, false, false);

            YVelocitySets["Up Velocity"].AddPoint(50, 1, false, false);
            YVelocitySets["Up Velocity"].AddPoint(-1, 0, false, false);
            YVelocitySets["Up Velocity"].AddPoint(-50, 0, false, false);
        }
        /// <summary>
        /// Setup X Velocity Sets
        /// </summary>
        private void SetupXVelocitySets()
        {
            XVelocitySets = new FuzzyCollection("XVelocity Sets", null)
            {
                new FuzzySet("High Left Velocity", -20, 20) { LineColour = new SolidBrush(Color.Blue) },
                new FuzzySet("Moderate Left Velocity", -20, 20) { LineColour = new SolidBrush(Color.Green) },
                new FuzzySet("Low Left Velocity", -20, 20) { LineColour = new SolidBrush(Color.Yellow) },

                new FuzzySet("Neutral Velocity", -20, 20) { LineColour = new SolidBrush(Color.Orange) },

                new FuzzySet("Low Right Velocity", -20, 20) { LineColour = new SolidBrush(Color.Red) },
                new FuzzySet("Moderate Right Velocity", -20, 20) { LineColour = new SolidBrush(Color.Purple) },
                new FuzzySet("High Right Velocity", -20, 20) { LineColour = new SolidBrush(Color.Pink) },
            };

            XVelocitySets["High Left Velocity"].AddPoint(-20, 1, false, false);
            XVelocitySets["High Left Velocity"].AddPoint(-15, 1, false, false);
            XVelocitySets["High Left Velocity"].AddPoint(-12, 0, false, false);
            XVelocitySets["High Left Velocity"].AddPoint(20, 0, false, false);

            XVelocitySets["Moderate Left Velocity"].AddPoint(-20, 0, false, false);
            XVelocitySets["Moderate Left Velocity"].AddPoint(-13, 0, false, false);
            XVelocitySets["Moderate Left Velocity"].AddPoint(-10, 1, false, false);
            XVelocitySets["Moderate Left Velocity"].AddPoint(-7, 0, false, false);
            XVelocitySets["Moderate Left Velocity"].AddPoint(20, 0, false, false);

            XVelocitySets["Low Left Velocity"].AddPoint(-20, 0, false, false);
            XVelocitySets["Low Left Velocity"].AddPoint(-8, 0, false, false);
            XVelocitySets["Low Left Velocity"].AddPoint(-5, 1, false, false);
            XVelocitySets["Low Left Velocity"].AddPoint(-1, 0, false, false);
            XVelocitySets["Low Left Velocity"].AddPoint(20, 0, false, false);

            XVelocitySets["Neutral Velocity"].AddPoint(-20, 0, false, false);
            XVelocitySets["Neutral Velocity"].AddPoint(-2, 0, false, false);
            XVelocitySets["Neutral Velocity"].AddPoint(0, 1, false, false);
            XVelocitySets["Neutral Velocity"].AddPoint(2, 0, false, false);
            XVelocitySets["Neutral Velocity"].AddPoint(20, 0, false, false);

            XVelocitySets["Low Right Velocity"].AddPoint(-20, 0, false, false);
            XVelocitySets["Low Right Velocity"].AddPoint(1, 0, false, false);
            XVelocitySets["Low Right Velocity"].AddPoint(5, 1, false, false);
            XVelocitySets["Low Right Velocity"].AddPoint(8, 0, false, false);
            XVelocitySets["Low Right Velocity"].AddPoint(20, 0, false, false);

            XVelocitySets["Moderate Right Velocity"].AddPoint(-20, 0, false, false);
            XVelocitySets["Moderate Right Velocity"].AddPoint(7, 0, false, false);
            XVelocitySets["Moderate Right Velocity"].AddPoint(10, 1, false, false);
            XVelocitySets["Moderate Right Velocity"].AddPoint(13, 0, false, false);
            XVelocitySets["Moderate Right Velocity"].AddPoint(20, 0, false, false);

            XVelocitySets["High Right Velocity"].AddPoint(-20, 0, false, false);
            XVelocitySets["High Right Velocity"].AddPoint(12, 0, false, false);
            XVelocitySets["High Right Velocity"].AddPoint(15, 1, false, false);
            XVelocitySets["High Right Velocity"].AddPoint(20, 1, false, false);
        }
        /// <summary>
        /// Setup Thrust Vector Sets
        /// </summary>
        private void SetupThrustVecSets()
        {
            ThrustVecSets = new FuzzyCollection("Thrust Vector Sets", null)
            {
                new FuzzySet("Forward High Thrust", -5, 5) { LineColour = new SolidBrush(Color.Blue) },
                new FuzzySet("Forward Moderate Thrust", -5, 5) { LineColour = new SolidBrush(Color.Green) },
                new FuzzySet("Forward Low Thrust", -5, 5) { LineColour = new SolidBrush(Color.Yellow) },

                new FuzzySet("Neutral Thrust", -5, 5) { LineColour = new SolidBrush(Color.Orange) },

                new FuzzySet("Backward Low Thrust", -5, 5) { LineColour = new SolidBrush(Color.Red) },
                new FuzzySet("Backward Moderate Thrust", -5, 5) { LineColour = new SolidBrush(Color.Purple) },
                new FuzzySet("Backward High Thrust", -5, 5) { LineColour = new SolidBrush(Color.Pink) }
            };

            ThrustVecSets["Forward High Thrust"].AddPoint(-5, 1, false, false);
            ThrustVecSets["Forward High Thrust"].AddPoint(-4, 1, false, false);
            ThrustVecSets["Forward High Thrust"].AddPoint(-3.5, 0, false, false);
            ThrustVecSets["Forward High Thrust"].AddPoint(5, 0, false, false);

            ThrustVecSets["Forward Moderate Thrust"].AddPoint(-5, 0, false, false);
            ThrustVecSets["Forward Moderate Thrust"].AddPoint(-4, 0, false, false);
            ThrustVecSets["Forward Moderate Thrust"].AddPoint(-3, 1, false, false);
            ThrustVecSets["Forward Moderate Thrust"].AddPoint(-2, 0, false, false);
            ThrustVecSets["Forward Moderate Thrust"].AddPoint(5, 0, false, false);

            ThrustVecSets["Forward Low Thrust"].AddPoint(-5, 0, false, false);
            ThrustVecSets["Forward Low Thrust"].AddPoint(-2.5, 0, false, false);
            ThrustVecSets["Forward Low Thrust"].AddPoint(-1.5, 1, false, false);
            ThrustVecSets["Forward Low Thrust"].AddPoint(-0.5, 0, false, false);
            ThrustVecSets["Forward Low Thrust"].AddPoint(5, 0, false, false);

            ThrustVecSets["Neutral Thrust"].AddPoint(-5, 0, false, false);
            ThrustVecSets["Neutral Thrust"].AddPoint(-1, 0, false, false);
            ThrustVecSets["Neutral Thrust"].AddPoint(0, 1, false, false);
            ThrustVecSets["Neutral Thrust"].AddPoint(1, 0, false, false);
            ThrustVecSets["Neutral Thrust"].AddPoint(5, 0, false, false);

            ThrustVecSets["Backward Low Thrust"].AddPoint(-5, 0, false, false);
            ThrustVecSets["Backward Low Thrust"].AddPoint(0.5, 0, false, false);
            ThrustVecSets["Backward Low Thrust"].AddPoint(1.5, 1, false, false);
            ThrustVecSets["Backward Low Thrust"].AddPoint(2.5, 0, false, false);
            ThrustVecSets["Backward Low Thrust"].AddPoint(5, 0, false, false);

            ThrustVecSets["Backward Moderate Thrust"].AddPoint(-5, 0, false, false);
            ThrustVecSets["Backward Moderate Thrust"].AddPoint(2, 0, false, false);
            ThrustVecSets["Backward Moderate Thrust"].AddPoint(3, 1, false, false);
            ThrustVecSets["Backward Moderate Thrust"].AddPoint(4, 0, false, false);
            ThrustVecSets["Backward Moderate Thrust"].AddPoint(5, 0, false, false);

            ThrustVecSets["Backward High Thrust"].AddPoint(-5, 0, false, false);
            ThrustVecSets["Backward High Thrust"].AddPoint(3.5, 0, false, false);
            ThrustVecSets["Backward High Thrust"].AddPoint(4, 1, false, false);
            ThrustVecSets["Backward High Thrust"].AddPoint(5, 1, false, false);
        }
        /// <summary>
        /// Setup Throttle Sets
        /// </summary>
        private void SetupThrottleSets()
        {
            ThrottleSets = new FuzzyCollection("Throttle Sets", null)
            {
                new FuzzySet("No Throttle", 0, 120) { LineColour = new SolidBrush(Color.Blue) },
                new FuzzySet("Hover Throttle", 0, 120) { LineColour = new SolidBrush(Color.Green) },
                new FuzzySet("Low Throttle", 0, 120) { LineColour = new SolidBrush(Color.Yellow) },
                new FuzzySet("Medium Throttle", 0, 120) { LineColour = new SolidBrush(Color.Orange) },
                new FuzzySet("High Throttle", 0, 120) { LineColour = new SolidBrush(Color.Red) }
            };

            ThrottleSets["No Throttle"].AddPoint(0, 1, false, false);
            ThrottleSets["No Throttle"].AddPoint(10, 1, false, false);
            ThrottleSets["No Throttle"].AddPoint(35, 0, false, false);
            ThrottleSets["No Throttle"].AddPoint(120, 0, false, false);

            ThrottleSets["Low Throttle"].AddPoint(0, 0, false, false);
            ThrottleSets["Low Throttle"].AddPoint(30, 0, false, false);
            ThrottleSets["Low Throttle"].AddPoint(45, 1, false, false);
            ThrottleSets["Low Throttle"].AddPoint(60, 1, false, false);
            ThrottleSets["Low Throttle"].AddPoint(70, 0, false, false);
            ThrottleSets["Low Throttle"].AddPoint(120, 0, false, false);

            ThrottleSets["Medium Throttle"].AddPoint(0, 0, false, false);
            ThrottleSets["Medium Throttle"].AddPoint(60, 0, false, false);
            ThrottleSets["Medium Throttle"].AddPoint(70, 1, false, false);
            ThrottleSets["Medium Throttle"].AddPoint(90, 1, false, false);
            ThrottleSets["Medium Throttle"].AddPoint(95, 0, false, false);
            ThrottleSets["Medium Throttle"].AddPoint(120, 0, false, false);

            ThrottleSets["Hover Throttle"].AddPoint(0, 0, false, false);
            ThrottleSets["Hover Throttle"].AddPoint(80, 0, false, false);
            ThrottleSets["Hover Throttle"].AddPoint(83, 1, false, false);
            ThrottleSets["Hover Throttle"].AddPoint(86, 0, false, false);
            ThrottleSets["Hover Throttle"].AddPoint(120, 0, false, false);

            ThrottleSets["High Throttle"].AddPoint(0, 0, false, false);
            ThrottleSets["High Throttle"].AddPoint(90, 0, false, false);
            ThrottleSets["High Throttle"].AddPoint(100, 1, false, false);
            ThrottleSets["High Throttle"].AddPoint(120, 1, false, false);
        }
        /// <summary>
        /// Initializes and sets up Rule Sets
        /// </summary>
        private void SetupRuleSets()
        {
            RuleSetThrottle = new FuzzyCollection("Throttle Rules", null);
            RuleSetThrustVec = new FuzzyCollection("Thrust Vector Rules", null);

            // Changes these as you add rules....
            int tRules = 21;
            int tvRules = 25;

            for (int i = 0; i < tRules; i++)
            {
                RuleSetThrottle.Add(new FuzzySet("Rule" + i.ToString(), 0, 120) { LineColour = ruleColours[i] });
                RuleSetThrottle["Rule" + i.ToString()].SetRangeWithPoints(0, 120);
            }

            for (int i = 0; i < tvRules; i++)
            {
                RuleSetThrustVec.Add(new FuzzySet("Rule" + i.ToString(), 0, 100) { LineColour = ruleColours[i] });
                RuleSetThrustVec["Rule" + i.ToString()].SetRangeWithPoints(-5, 5);
            }
        }
        /// <summary>
        /// Setup Height Sets
        /// </summary>
        private void SetupHeightSets()
        {
            HeightSets = new FuzzyCollection("Height Sets", null)
            {
                new FuzzySet("Below Deck Height", -20, 400) { LineColour = new SolidBrush(Color.Blue) },
                new FuzzySet("Landing Height", -20, 400) { LineColour = new SolidBrush(Color.Green) },
                new FuzzySet("Low Height", -20, 400) { LineColour = new SolidBrush(Color.Yellow) },
                new FuzzySet("Medium Height", -20, 400) { LineColour = new SolidBrush(Color.Orange) },
                new FuzzySet("High Height", -20, 400) { LineColour = new SolidBrush(Color.Red) }

            };

            HeightSets["Below Deck Height"].AddPoint(-20, 1, false, false);
            HeightSets["Below Deck Height"].AddPoint(-2, 1, false, false);
            HeightSets["Below Deck Height"].AddPoint(5, 0, false, false);
            HeightSets["Below Deck Height"].AddPoint(400, 0, false, false);

            HeightSets["Landing Height"].AddPoint(-20, 0, false, false);
            HeightSets["Landing Height"].AddPoint(0, 1, false, false);
            HeightSets["Landing Height"].AddPoint(5, 1, false, false);
            HeightSets["Landing Height"].AddPoint(10, 0, false, false);
            HeightSets["Landing Height"].AddPoint(400, 0, false, false);

            HeightSets["Low Height"].AddPoint(-20, 0, false, false);
            HeightSets["Low Height"].AddPoint(3, 0, false, false);
            HeightSets["Low Height"].AddPoint(10, 1, false, false);
            HeightSets["Low Height"].AddPoint(15, 1, false, false);
            HeightSets["Low Height"].AddPoint(20, 0, false, false);
            HeightSets["Low Height"].AddPoint(400, 0, false, false);

            HeightSets["Medium Height"].AddPoint(-20, 0, false, false);
            HeightSets["Medium Height"].AddPoint(17, 0, false, false);
            HeightSets["Medium Height"].AddPoint(40, 1, false, false);
            HeightSets["Medium Height"].AddPoint(60, 1, false, false);
            HeightSets["Medium Height"].AddPoint(90, 0, false, false);
            HeightSets["Medium Height"].AddPoint(400, 0, false, false);

            HeightSets["High Height"].AddPoint(-20, 0, false, false);
            HeightSets["High Height"].AddPoint(70, 0, false, false);
            HeightSets["High Height"].AddPoint(120, 1, false, false);
            HeightSets["High Height"].AddPoint(400, 1, false, false);
        }
        /// <summary>
        /// Setup Distance Sets
        /// </summary>
        private void SetupDistanceSets()
        {
            DistanceSets = new FuzzyCollection("Distance Sets", null)
            {
                new FuzzySet("Left High Dangerzone", -1000, 1000) { LineColour = new SolidBrush(Color.Blue) },
                new FuzzySet("Left Moderate Dangerzone", -1000, 1000) { LineColour = new SolidBrush(Color.Green) },
                new FuzzySet("Left Low Dangerzone", -1000, 1000) { LineColour = new SolidBrush(Color.Yellow) },

                new FuzzySet("Safe Zone", -1000, 1000) { LineColour = new SolidBrush(Color.Orange) },

                new FuzzySet("Right Low Dangerzone", -1000, 1000) { LineColour = new SolidBrush(Color.Red) },
                new FuzzySet("Right Moderate Dangerzone", -1000, 1000) { LineColour = new SolidBrush(Color.Purple) },
                new FuzzySet("Right High Dangerzone", -1000, 1000) { LineColour = new SolidBrush(Color.Pink) }
            };

            DistanceSets["Left High Dangerzone"].AddPoint(-1000, 1, false, false);
            DistanceSets["Left High Dangerzone"].AddPoint(-150, 1, false, false);
            DistanceSets["Left High Dangerzone"].AddPoint(-130, 0, false, false);
            DistanceSets["Left High Dangerzone"].AddPoint(1000, 0, false, false);

            DistanceSets["Left Moderate Dangerzone"].AddPoint(-1000, 0, false, false);
            DistanceSets["Left Moderate Dangerzone"].AddPoint(-140, 0, false, false);
            DistanceSets["Left Moderate Dangerzone"].AddPoint(-120, 1, false, false);
            DistanceSets["Left Moderate Dangerzone"].AddPoint(-100, 1, false, false);
            DistanceSets["Left Moderate Dangerzone"].AddPoint(-80, 0, false, false);
            DistanceSets["Left Moderate Dangerzone"].AddPoint(1000, 0, false, false);

            DistanceSets["Left Low Dangerzone"].AddPoint(-1000, 0, false, false);
            DistanceSets["Left Low Dangerzone"].AddPoint(-100, 0, false, false);
            DistanceSets["Left Low Dangerzone"].AddPoint(-80, 1, false, false);
            DistanceSets["Left Low Dangerzone"].AddPoint(-60, 1, false, false);
            DistanceSets["Left Low Dangerzone"].AddPoint(-50, 0, false, false);
            DistanceSets["Left Low Dangerzone"].AddPoint(1000, 0, false, false);

            DistanceSets["Safe Zone"].AddPoint(-1000, 0, false, false);
            DistanceSets["Safe Zone"].AddPoint(-70, 0, false, false);
            DistanceSets["Safe Zone"].AddPoint(-50, 1, false, false);
            DistanceSets["Safe Zone"].AddPoint(50, 1, false, false);
            DistanceSets["Safe Zone"].AddPoint(70, 0, false, false);
            DistanceSets["Safe Zone"].AddPoint(1000, 0, false, false);

            DistanceSets["Right Low Dangerzone"].AddPoint(-1000, 0, false, false);
            DistanceSets["Right Low Dangerzone"].AddPoint(50, 0, false, false);
            DistanceSets["Right Low Dangerzone"].AddPoint(60, 1, false, false);
            DistanceSets["Right Low Dangerzone"].AddPoint(80, 1, false, false);
            DistanceSets["Right Low Dangerzone"].AddPoint(100, 0, false, false);
            DistanceSets["Right Low Dangerzone"].AddPoint(1000, 0, false, false);

            DistanceSets["Right Moderate Dangerzone"].AddPoint(-1000, 0, false, false);
            DistanceSets["Right Moderate Dangerzone"].AddPoint(80, 0, false, false);
            DistanceSets["Right Moderate Dangerzone"].AddPoint(100, 1, false, false);
            DistanceSets["Right Moderate Dangerzone"].AddPoint(120, 1, false, false);
            DistanceSets["Right Moderate Dangerzone"].AddPoint(140, 0, false, false);
            DistanceSets["Right Moderate Dangerzone"].AddPoint(1000, 0, false, false);

            DistanceSets["Right High Dangerzone"].AddPoint(-1000, 0, false, false);
            DistanceSets["Right High Dangerzone"].AddPoint(140, 0, false, false);
            DistanceSets["Right High Dangerzone"].AddPoint(150, 1, false, false);
            DistanceSets["Right High Dangerzone"].AddPoint(1000, 1, false, false);
        }
        /// <summary>
        /// Set up Throttle and ThrustVector Output sets 
        /// </summary>
        private void SetupAccumulators()
        {
            //Throttle Accumulator
            ThrottleAccum = new FuzzyCollection("Throttle Output", null)
                                {
                                    new FuzzySet("ThrottleOutput", 0, 120)
                                };
            ThrottleAccum["ThrottleOutput"].SetRangeWithPoints(0, 120);

            //ThrustVector Accumulator
            ThrustVecAccum = new FuzzyCollection("Thrust Vector Output", null)
                                 {
                                     new FuzzySet("ThrustVector", -5, 5)
                                 };
            ThrustVecAccum["ThrustVector"].SetRangeWithPoints(-5, 5);
        }