/// <summary> /// True if this set is a subset of setToCompare. I.e. if they share a common dimension and μthis(x) <= μsetToCompare(x) for each x in <dimension.minValue, dimension.MaxValue>. /// 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())); }
/// <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 <dimension.minValue, dimension.MaxValue> /// </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())); }