Package expressions

Examples of expressions.FuzzyUnaryExpression


            FuzzyConstantExpression cstexp = (FuzzyConstantExpression) exp;
            int val = (int) (Math.round(cstexp.getValue() * numberOfDegrees));
            return new IntegerConstantVariable(val);
        }
        else if (exp instanceof FuzzyUnaryExpression) {
            FuzzyUnaryExpression unexp = (FuzzyUnaryExpression) exp;
            if (unexp.getOperator() instanceof N) {
                IntegerExpressionVariable arg = getExpression(unexp.getArgument());
                return plus(numberOfDegrees, mult(arg, -1));
            }
            else if(unexp.getOperator() instanceof NM){
                Constraint cnstr = lt(0,getExpression(unexp.getArgument()));
                return ifThenElse(cnstr,new IntegerConstantVariable(0),new IntegerConstantVariable(numberOfDegrees));
            }
            else
                throw new UnsupportedOperationException();
        }
View Full Code Here


            FuzzyConstantExpression cstexp = (FuzzyConstantExpression) exp;
            int val = (int) (Math.round(cstexp.getValue() * totalNumberOfDegrees));
            return new IntegerConstantVariable(val);
        }
        else if (exp instanceof FuzzyUnaryExpression) {
            FuzzyUnaryExpression unexp = (FuzzyUnaryExpression) exp;
            if (unexp.getOperator() instanceof N) {
                IntegerExpressionVariable arg = getExpression(unexp.getArgument());
                return plus(totalNumberOfDegrees, mult(arg, -1));
            }
            else if(unexp.getOperator() instanceof NM){
                Constraint cnstr = lt(0,getExpression(unexp.getArgument()));
                return ifThenElse(cnstr,new IntegerConstantVariable(0),new IntegerConstantVariable(totalNumberOfDegrees));
            }
            else
                throw new UnsupportedOperationException();
        }
View Full Code Here

  public FuzzyExpression convertToFuzzyExpression () {
    if (!isNaf())
      return new FuzzyVariableExpression(toString());
    else
      if(!isNegated())
        return new FuzzyUnaryExpression(p.convertToFuzzyExpression(),neg);
      else
        return new FuzzyUnaryExpression(new FuzzyVariableExpression("-"+p.toString()),neg);
  }
View Full Code Here

TOP

Related Classes of expressions.FuzzyUnaryExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.