Exemplo n.º 1
0
        public override double Evaluate(IDictionary <Class, double> membershipValues)
        {
            var leftValue  = LeftArgument.Evaluate(membershipValues);
            var rightValue = RightArgument.Evaluate(membershipValues);

            return(Math.Min(leftValue, rightValue));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Checks the equality of objects.
        /// </summary>
        /// <param name="obj">Object to be checked.</param>
        /// <returns>True if the objects are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            EqualsExpression other = obj as EqualsExpression;

            if (other == null)
            {
                return(false);
            }
            return(LeftArgument.Equals(other.LeftArgument) && RightArgument.Equals(other.RightArgument));
        }
        /// <summary>
        /// Checks the equality of objects.
        /// </summary>
        /// <param name="obj">Object to be checked.</param>
        /// <returns>True if the objects are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            NumericCompareExpression other = obj as NumericCompareExpression;

            if (other == null)
            {
                return(false);
            }
            return((Operator == other.Operator) && LeftArgument.Equals(other.LeftArgument) && RightArgument.Equals(other.RightArgument));
        }
 public override double Operation()
 {
     if (RightArgument.Operation() != 0)
     {
         return(LeftArgument.Operation() / RightArgument.Operation());
     }
     else
     {
         throw new DivideByZeroException("Divizion by zero");
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Checks the equality of objects.
        /// </summary>
        /// <param name="obj">Object to be checked.</param>
        /// <returns>True if the objects are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            EqualsLiteralCNF other = obj as EqualsLiteralCNF;

            if (other == null)
            {
                return(false);
            }

            return(LeftArgument.Equals(other.LeftArgument) && RightArgument.Equals(other.RightArgument) && IsNegated == other.IsNegated);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Checks the equality of objects.
        /// </summary>
        /// <param name="obj">Object to be checked.</param>
        /// <returns>True if the objects are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            EqualsEffect other = obj as EqualsEffect;

            if (other == null)
            {
                return(false);
            }

            return(LeftArgument.Equals(other.LeftArgument) &&
                   RightArgument.Equals(other.RightArgument));
        }
        /// <summary>
        /// Checks the equality of objects.
        /// </summary>
        /// <param name="obj">Object to be checked.</param>
        /// <returns>True if the objects are equal, false otherwise.</returns>
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            NumericCompareLiteralCNF other = obj as NumericCompareLiteralCNF;

            if (other == null)
            {
                return(false);
            }

            return(Operator.Equals(other.Operator) &&
                   LeftArgument.Equals(other.LeftArgument) &&
                   RightArgument.Equals(other.RightArgument) &&
                   IsNegated == other.IsNegated);
        }
Exemplo n.º 8
0
 public override double Operation()
 {
     return(LeftArgument.Operation() * RightArgument.Operation());
 }
Exemplo n.º 9
0
 /// <summary>
 /// Creates a deep copy of the expression.
 /// </summary>
 /// <returns>Expression clone.</returns>
 public IExpression Clone()
 {
     return(new EqualsExpression(LeftArgument.Clone(), RightArgument.Clone()));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Creates a deep copy of the expression.
 /// </summary>
 /// <returns>Expression clone.</returns>
 public override IConjunctCNF Clone()
 {
     return(new EqualsLiteralCNF(LeftArgument.Clone(), RightArgument.Clone(), IsNegated));
 }
 /// <summary>
 /// Creates a deep copy of the expression.
 /// </summary>
 /// <returns>Expression clone.</returns>
 public IExpression Clone()
 {
     return(new NumericCompareExpression(Operator, LeftArgument.Clone(), RightArgument.Clone()));
 }
 /// <summary>
 /// Creates a deep copy of the expression.
 /// </summary>
 /// <returns>Expression clone.</returns>
 public override IConjunctCNF Clone()
 {
     return(new NumericCompareLiteralCNF(Operator, LeftArgument.Clone(), RightArgument.Clone(), IsNegated));
 }
Exemplo n.º 13
0
 public override double Operation()
 {
     return(Math.Pow(LeftArgument.Operation(), RightArgument.Operation()));
 }