GetOrAddHedgedSet() private method

Get the Hedged Set or Add it
private GetOrAddHedgedSet ( string setName, string hedges ) : FuzzySet
setName string
hedges string
return FuzzySet
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;
        }