Ejemplo n.º 1
0
 /// <summary>
 /// Creates new instance of image just to display a single-dimensional fuzzy set without any values specified.
 /// </summary>
 /// <param name="singleDimensionalSet">Single-dimensional set to display</param>
 public RelationImage(FuzzySet singleDimensionalSet)
 {
     _inputs = new Dictionary<IDimension, decimal> { };
     _relation = singleDimensionalSet;
     _variableDimension = singleDimensionalSet.Dimensions[0];
     _fullySpecified = false;
     _specifiedMembership = null;
 }
Ejemplo n.º 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()));
        }
Ejemplo n.º 3
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());
        }