コード例 #1
0
        /// <summary>
        /// True if this set is a subset of setToCompare. I.e. if they share a common dimension and μthis(x) &lt;= μsetToCompare(x) for each x in &lt;dimension.minValue, dimension.MaxValue&gt;.
        /// Note that equalty is a special case of inclusion. To check for proper inclusion, you woud have to evaluate if this.Includes(setToCompare) && ! this.Equals(setToCompare).
        /// </summary>
        /// <param name="setToCompare">Set to compare</param>
        /// <returns>True if this set is a subset of setToCompare.</returns>
        public bool Includes(FuzzySet setToCompare)
        {
            FuzzySet fsSetToCompare = setToCompare;

            if (this._dimension != fsSetToCompare.Dimensions[0])
            {
                return(false);
            }

            return(this.GetFunction().Includes(fsSetToCompare.GetFunction()));
        }
コード例 #2
0
        /// <summary>
        /// True if this set is equal to relationToCompare. I.e. if they share a common dimension and μthis(x) = μsetToCompare(x) for each x in &lt;dimension.minValue, dimension.MaxValue&gt;
        /// </summary>
        /// <param name="setToCompare">Relation to compare</param>
        /// <returns>True if this setis equal to setToCompare.</returns>
        public override bool Equals(object setToCompare)
        {
            if (!(setToCompare is FuzzySet))
            {
                return(false);
            }

            FuzzySet fsSetToCompare = (FuzzySet)setToCompare;

            if (this._dimension != fsSetToCompare.Dimensions[0])
            {
                return(false);
            }

            return(this.GetFunction().Equals(fsSetToCompare.GetFunction()));
        }