Evaluate() method
347338
@Override
  public void evaluate(DoubleSolution solution) {
    int numberOfVariables = getNumberOfVariables() ;

    double[] x = new double[numberOfVariables] ;

    for (int i = 0; i < numberOfVariables; i++) {
      x[i] = solution.getVariableValue(i) ;
    }

    double sum = 0.0;

    for (int i = 0; i < numberOfVariables - 1; i++) {
      double temp1 = (x[i] * x[i]) - x[i + 1];
      double temp2 = x[i] - 1.0;
      sum += (100.0 * temp1 * temp1) + (temp2 * temp2);
    }

    solution.setObjective(0, sum);
  }
374395
@Override
  public void evaluate(IntegerDoubleSolution solution) {
    int approximationToN;
    int approximationToM ;

    approximationToN = 0;
    approximationToM = 0;

    for (int i = 0; i < solution.getNumberOfIntegerVariables(); i++) {
      int value = solution.getVariableValue(i).intValue() ;
      approximationToN += Math.abs(valueN - value) ;
      approximationToM += Math.abs(valueM - value) ;
    }

    for (int i = solution.getNumberOfIntegerVariables(); i < (solution.getNumberOfIntegerVariables()+solution.getNumberOfDoubleVariables()); i++) {
      double value = solution.getVariableValue(i).doubleValue() ;
      approximationToN += Math.abs(valueN - value) ;
      approximationToM += Math.abs(valueM - value) ;
    }

    solution.setObjective(0, approximationToN);
    solution.setObjective(1, approximationToM);
  }
68690
@Override
    public boolean evaluate() throws QueryEvaluationException {
        try {
            sync();
            return getMarkLogicClient().sendBooleanQuery(getQueryString(), getBindings(), getIncludeInferred(),getBaseURI());
        }catch (RepositoryException e) {
            throw new QueryEvaluationException(e.getMessage(), e);
        }catch (MalformedQueryException e) {
            throw new QueryEvaluationException(e.getMessage(), e);
        }catch (IOException e) {
            throw new QueryEvaluationException(e.getMessage(), e);
        }catch(FailedRequestException e){
            throw new QueryEvaluationException(e.getMessage(), e);
        }
    }
953122
@Override
  public void evaluate(DoubleSolution solution) {
    double[] x = new double[getNumberOfVariables()];
    for (int i = 0; i < solution.getNumberOfVariables(); i++) {
      x[i] = solution.getVariableValue(i) ;
    }

  	int count1, count2;
		double sum1, sum2, yj, hj ;
		sum1   = sum2   = 0.0;
		count1 = count2 = 0;
    
    for (int j = 2 ; j <= getNumberOfVariables(); j++) {
			yj = x[j-1]-Math.sin(6.0*Math.PI*x[0]+j*Math.PI/getNumberOfVariables());
			hj = 2.0*yj*yj - Math.cos(4.0*Math.PI*yj) + 1.0;
			if (j % 2 == 0) {
				sum2  += hj;
				count2++;
			} else {
				sum1  += hj;
				count1++;
			}
    }
    hj = (0.5/n + epsilon)*Math.abs(Math.sin(2.0*n*Math.PI*x[0]));

    solution.setObjective(0, x[0] + hj + 2.0*sum1 / (double)count1);
    solution.setObjective(1, 1.0 - x[0] + hj + 2.0*sum2 / (double)count2);
  }
47434
public Object eval(Scope scope) {
		if (index == null) {
			return assignVariable(scope);
		} else {
			return assignElement(scope);
		}
	}
384468
@Override
  public void evaluate(DoubleSolution solution) {
    int numberOfVariables = solution.getNumberOfVariables();
    int numberOfObjectives = solution.getNumberOfObjectives();

    double[] x = new double[numberOfVariables];
    double[] f = new double[numberOfObjectives];

    for (int i = 0; i < numberOfVariables; i++) {
      x[i] = solution.getVariableValue(i);
    }

    // evaluate g,h
    double g = 0, h = 0, sub1;
    for (int i = numberOfObjectives - 1; i < numberOfVariables; i++) {
      g += x[i];
    }
    g = 1 + 9 * g / (numberOfVariables - numberOfObjectives + 1);
    sub1 = 1 + g;
    for (int i = 0; i < numberOfObjectives - 1; i++) {
      h += (x[i] * (1 + Math.sin(3 * Math.PI * x[i])) / sub1);
    }
    h = numberOfObjectives - h;
    // evaluate f1,...,m-1,m
    for (int i = 0; i < numberOfObjectives; i++) {
      f[i] = x[i];
    }
    f[numberOfObjectives - 1] = h * sub1;

    for (int i = 0; i < numberOfObjectives; i++) {
      solution.setObjective(i, f[i]);
    }

  }
386506
public Object eval(String expression) {
    	expression = transform(expression);
    	Object result = calculate(expression);
        return result;
    }
177004
@Override
  public void evaluate(DoubleSolution solution) {
    int numberOfVariables = getNumberOfVariables() ;

    double[] x = new double[numberOfVariables] ;

    for (int i = 0; i < numberOfVariables; i++) {
      x[i] = solution.getVariableValue(i) ;
    }

    double result = 0.0;
    double a = 10.0;
    double w = 2 * Math.PI;

    for (int i = 0; i < numberOfVariables; i++) {
      result += x[i] * x[i] - a * Math.cos(w * x[i]);
    }
    result += a * numberOfVariables;

    solution.setObjective(0, result);
  }
145942
private void evaluateExpressions() throws JspException {
        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        if (value_ != null) {
            value = ExpressionEvaluatorManager.evaluate(
                    "value", value_, Object.class, this, pageContext);
        }
    }
1153594
public Object evaluate(Object pContext,
                           VariableResolver pResolver,
                           Map functions,
                           String defaultPrefix,
                           Logger pLogger)
            throws ELException {
        return mValue;
    }
359077
@Override
  public void evaluate(DoubleSolution solution) {

    int numberOfVariables_ = solution.getNumberOfVariables();
    int numberOfObjectives_ = solution.getNumberOfObjectives();

    double[] x = new double[numberOfVariables_];
    double[] f = new double[numberOfObjectives_];

    for (int i = 0; i < numberOfVariables_; i++) {
      x[i] = solution.getVariableValue(i);
    }

    // evaluate zi,t1i,t2i,t3i,t4i,yi
    double[] z = new double[numberOfVariables_];
    double[] t1 = new double[numberOfVariables_];
    double[] t2 = new double[numberOfVariables_];
    double[] t3 = new double[numberOfVariables_];
    double[] t4 = new double[numberOfObjectives_];
    double[] y = new double[numberOfObjectives_];
    double sub1 = 0, sub2 = 0;
    int lb = 0, ub = 0;
    for (int i = 0; i < K10; i++) {
      z[i] = x[i] / (2 * i + 2);
      t1[i] = z[i];
      t2[i] = t1[i];
      t3[i] = Math.pow(t2[i], 0.02);
    }
    for (int i = K10; i < numberOfVariables_; i++) {
      z[i] = x[i] / (2 * i + 2);
      t1[i] = Math.abs(z[i] - 0.35) / (Math.abs(Math.floor(0.35 - z[i]) + 0.35));
      t2[i] = 0.8 + 0.8 * (0.75 - t1[i]) * Math.min(0, Math.floor(t1[i] - 0.75)) / 0.75
          - 0.2 * (t1[i] - 0.85) * Math.min(0, Math.floor(0.85 - t1[i])) / 0.15;
      t2[i] = Math.round(t2[i] * 1000000) / 1000000.0;
      t3[i] = Math.pow(t2[i], 0.02);
    }
    for (int i = 0; i < numberOfObjectives_ - 1; i++) {
      sub1 = 0;
      sub2 = 0;
      lb = i * K10 / (numberOfObjectives_ - 1) + 1;
      ub = (i + 1) * K10 / (numberOfObjectives_ - 1);
      for (int j = lb - 1; j < ub; j++) {
        sub1 += (2 * (j + 1) * t3[j]);
        sub2 += (2 * (j + 1));
      }
      t4[i] = sub1 / sub2;
    }
    lb = K10 + 1;
    ub = numberOfVariables_;
    sub1 = 0;
    sub2 = 0;
    for (int j = lb - 1; j < ub; j++) {
      sub1 += (2 * (j + 1) * t3[j]);
      sub2 += (2 * (j + 1));
    }
    t4[numberOfObjectives_ - 1] = sub1 / sub2;
    for (int i = 0; i < numberOfObjectives_ - 1; i++) {
      y[i] = (t4[i] - 0.5) * Math.max(1, t4[numberOfObjectives_ - 1]) + 0.5;
    }
    y[numberOfObjectives_ - 1] = t4[numberOfObjectives_ - 1];

    // evaluate fm,fm-1,...,2,f1
    double subf1 = 1;
    f[numberOfObjectives_ - 1] = y[numberOfObjectives_ - 1] + 2 * numberOfObjectives_ * (1 - y[0]
        - Math.cos(10 * Math.PI * y[0] + Math.PI / 2) / (10 * Math.PI));
    for (int i = numberOfObjectives_ - 2; i > 0; i--) {
      subf1 *= (1 - Math.cos(Math.PI * y[numberOfObjectives_ - i - 2] / 2));
      f[i] = y[numberOfObjectives_ - 1] + 2 * (i + 1) * subf1 * (1 - Math
          .sin(Math.PI * y[numberOfObjectives_ - i - 1] / 2));
    }
    f[0] = y[numberOfObjectives_ - 1] + 2 * subf1 * (1 - Math
        .cos(Math.PI * y[numberOfObjectives_ - 2] / 2));

    for (int i = 0; i < numberOfObjectives_; i++) {
      solution.setObjective(i, f[i]);
    }
  }
607108
private void evaluateExpressions() throws JspException {
        Object obj = null;

        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        // 'value' attribute
        if (value_ != null) {
            value = (String) ExpressionEvaluatorManager.evaluate(
                    "value", value_, String.class, this, pageContext);
        }

        // 'type' attribute
        if (type_ != null) {
            type = (String) ExpressionEvaluatorManager.evaluate(
                    "type", type_, String.class, this, pageContext);
        }

        // 'pattern' attribute
        if (pattern_ != null) {
            pattern = (String) ExpressionEvaluatorManager.evaluate(
                    "pattern", pattern_, String.class, this, pageContext);
        }

        // 'parseLocale' attribute
        if (parseLocale_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "parseLocale", parseLocale_, Object.class, this, pageContext);
            Locale locale = LocaleUtil.parseLocaleAttributeValue(obj);
            if (locale != null) {
                this.parseLocale = locale;
            }
        }

        // 'integerOnly' attribute
        if (integerOnly_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "integerOnly", integerOnly_, Boolean.class, this, pageContext);
            if (obj != null) {
                isIntegerOnly = ((Boolean) obj).booleanValue();
            }
        }
    }
756047
public Object evaluate()
  {
    if( !isCompileTimeConstant() )
    {
      return super.evaluate();
    }

    return evaluate( getType(), getLHS().evaluate(), getRHS().evaluate(), getLHS().getType(), getRHS().getType(), isAdditive(), false, !getType().equals( JavaTypes.STRING() ) );
  }
387051
@Override
  public void evaluate(DoubleSolution solution) {
    int numberOfVariables = getNumberOfVariables() ;

    double[] f = new double[getNumberOfObjectives()];
    double[] x = new double[numberOfVariables] ;

    for (int i = 0; i < numberOfVariables; i++) {
      x[i] = solution.getVariableValue(i) ;
    }
                 
    f[0] = 0.5 * (x[0]*x[0] + x[1]*x[1]) + Math.sin(x[0]*x[0] + x[1]*x[1]) ;

    // Second function
    double value1 = 3.0 * x[0] - 2.0 * x[1] + 4.0 ;
    double value2 = x[0] - x[1] + 1.0 ;
    f[1] = (value1 * value1)/8.0 + (value2 * value2)/27.0 + 15.0 ;

    // Third function
    f[2] = 1.0 / (x[0]*x[0] + x[1]*x[1]+1) - 1.1 *
          Math.exp(-(x[0]*x[0])-(x[1]*x[1])) ;

        
    for (int i = 0; i < getNumberOfObjectives(); i++)
      solution.setObjective(i,f[i]);        
  }
84433
function(ctx) {
    assert(this.args.length == 3);
    if (this.args[0].evaluate(ctx).booleanValue()) {
      return this.args[1].evaluate(ctx);
    } else {
      return this.args[2].evaluate(ctx);
    }
  }
913906
Object evaluate(String pExpressionString,
                    Object pContext,
                    Class pExpectedType,
                    Map functions,
                    String defaultPrefix,
                    Logger pLogger)
            throws ELException {
        // Check for null expression strings
        if (pExpressionString == null) {
            throw new ELException
                    (Constants.NULL_EXPRESSION_STRING);
        }

        // Set the PageContext;
        pageContext = (PageContext) pContext;

        // Get the parsed version of the expression string
        Object parsedValue = parseExpressionString(pExpressionString);

        // Evaluate differently based on the parsed type
        if (parsedValue instanceof String) {
            // Convert the String, and cache the conversion
            String strValue = (String) parsedValue;
            return convertStaticValueToExpectedType(strValue,
                    pExpectedType,
                    pLogger);
        } else if (parsedValue instanceof Expression) {
            // Evaluate the expression and convert
            Object value =
                    ((Expression) parsedValue).evaluate(pContext,
                            mResolver,
                            functions,
                            defaultPrefix,
                            pLogger);
            return convertToExpectedType(value,
                    pExpectedType,
                    pLogger);
        } else if (parsedValue instanceof ExpressionString) {
            // Evaluate the expression/string list and convert
            String strValue =
                    ((ExpressionString) parsedValue).evaluate(pContext,
                            mResolver,
                            functions,
                            defaultPrefix,
                            pLogger);
            return convertToExpectedType(strValue,
                    pExpectedType,
                    pLogger);
        } else {
            // This should never be reached
            return null;
        }
    }
1069101
public Object evaluate()
  {
    if( !isCompileTimeConstant() )
    {
      return super.evaluate();
    }

    return (Boolean)getLHS().evaluate() || (Boolean)getRHS().evaluate();
  }