public override double Evaluate(IDictionary <Class, double> membershipValues) { var leftValue = LeftArgument.Evaluate(membershipValues); var rightValue = RightArgument.Evaluate(membershipValues); return(Math.Min(leftValue, rightValue)); }
/// <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"); } }
/// <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); }
/// <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); }
public override double Operation() { return(LeftArgument.Operation() * RightArgument.Operation()); }
/// <summary> /// Creates a deep copy of the expression. /// </summary> /// <returns>Expression clone.</returns> public IExpression Clone() { return(new EqualsExpression(LeftArgument.Clone(), RightArgument.Clone())); }
/// <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)); }
public override double Operation() { return(Math.Pow(LeftArgument.Operation(), RightArgument.Operation())); }