public double evaluate(Assignment input){
  Assignment input2=(functions.isEmpty()) ? input : input.copy();
  for (  FunctionalTemplate f : functions) {
    CustomFunction fu=f.getFunction();
    Value result=f.getValue(input2);
    input2.addPair((fu.getName() + f.hashCode()),result);
  }
  Expression exp2=new Expression(exp);
  exp2.setVariables(getDoubles(input2));
  double result=exp2.evaluate();
  return result;
}

public double evaluate ( Assignment input ) { Assignment input2 = ( functions . isEmpty ( ) ) ? input : input . copy ( ) ; for ( FunctionalTemplate f : functions ) { CustomFunction fu = f . getFunction ( ) ; Value result = f . getValue ( input2 ) ; input2 . addPair ( ( fu . getName ( ) + f . hashCode ( ) ) , result ) ; } Expression exp2 = new Expression ( exp ) ; exp2 . setVariables ( getDoubles ( input2 ) ) ; double result = exp2 . evaluate ( ) ; return result ; }
evaluates the result of the expression , given an assignment of values to the unknown variables
