UnityAI.Core.Fuzzy.ContinuousFuzzyRuleVariable.GetSet C# (CSharp) Method

GetSet() private method

Get the Set By Name
private GetSet ( string setName ) : FuzzySet
setName string
return FuzzySet
        internal virtual FuzzySet GetSet(string setName)
        {
            if (SetExist(setName))
            {
                return (FuzzySet)(moSetList[setName]);
            }
            else
            {
                return null;
            }
        }

Usage Example

Example #1
0
        /// <summary>
        /// Get the FuzzySet based on the hedges
        /// </summary>
        /// <param name="lhs">Left Hand Side</param>
        /// <param name="setName">The Set Name that contains the Right Hand Side</param>
        /// <param name="hedges">The Hedge Name that contains the list of hedges</param>
        /// <returns></returns>
        private FuzzySet GetFuzzySet(ContinuousFuzzyRuleVariable lhs, string setName, string hedges)
        {
            FuzzySet rhs = null;
            string sValue = setName.Trim();
            string tmpHedges = hedges.Trim();

            // The value on the Rhs represents a fuzzy set name;
            // The named set must exist.
            if (lhs.SetExist(sValue))
            {
                if (tmpHedges.Length == 0)
                {
                    rhs = lhs.GetSet(sValue);
                }
                else
                {
                    rhs = lhs.GetOrAddHedgedSet(sValue, tmpHedges);
                }
            }
            else
            {
                Console.Out.WriteLine("Error: Invalid fuzzy set name " + sValue);
            }
            return rhs;
        }