Evaluate() method
768038
@Override
  public void evaluate(IntegerSolution solution) {
    int approximationToN;

    approximationToN = 0;

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

    solution.setObjective(0, approximationToN);
  }
1020099
def evaluate_expression(expression, vars):
    ''''''
    try:
        v = eval(expression, globals(), vars)
    except NameError:
        return None
    except ZeroDivisionError:
        return None
    return v
1142070
@Override
  public void evaluate(DoubleSolution solution) {
    double x1,x2,x3,x4,x5,x6,x7;
    x1 = solution.getVariableValue(0);
    x2 = solution.getVariableValue(1);
    x3 = solution.getVariableValue(2);
    x4 = solution.getVariableValue(3);
    x5 = solution.getVariableValue(4);
    x6 = solution.getVariableValue(5);
    x7 = solution.getVariableValue(6);

    double f1 = 0.7854 * x1 *x2 *x2 * ((10*x3*x3)/3.0 + 14.933*x3 - 43.0934) -
        1.508*x1*(x6*x6 + x7*x7)+7.477*(x6*x6*x6 + x7*x7*x7) +
        0.7854*(x4*x6*x6 + x5*x7*x7);

    double aux = 745.0 * x4 / (x2 * x3);
    double f2 = Math.sqrt((aux*aux)+1.69e7) / (0.1*x6*x6*x6);

    solution.setObjective(0,f1);
    solution.setObjective(1,f2);

    this.evaluateConstraints(solution);
  }
281699
@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) ;
    }

    double sum1 = 0.0;
    for (int i = 0; i < numberOfVariables; i++) {
      sum1 += StrictMath.pow(x[i] - (1.0 / StrictMath.sqrt((double) numberOfVariables)), 2.0);
    }
    double exp1 = StrictMath.exp((-1.0) * sum1);
    f[0] = 1 - exp1;

    double sum2 = 0.0;
    for (int i = 0; i < numberOfVariables; i++) {
      sum2 += StrictMath.pow(x[i] + (1.0 / StrictMath.sqrt((double) numberOfVariables)), 2.0);
    }
    double exp2 = StrictMath.exp((-1.0) * sum2);
    f[1] = 1 - exp2;

    solution.setObjective(0, f[0]);
    solution.setObjective(1, f[1]);
  }
293542
public void evaluate(DoubleSolution solution) {
    double[] f = new double[getNumberOfObjectives()];

    double g = this.evalG(solution);
    f[0] = (1 + g) * solution.getVariableValue(0) * solution.getVariableValue(1);
    f[1] = (1 + g) * solution.getVariableValue(0) * (1 - solution.getVariableValue(1));
    f[2] = (1 + g) * (1 - solution.getVariableValue(0));

    solution.setObjective(0, f[0]);
    solution.setObjective(1, f[1]);
    solution.setObjective(2, f[2]);
  }
784795
@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);
    }

    double subf1 = 1;
    // 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[numberOfObjectives_];
    double[] y = new double[numberOfObjectives_];
    double sub1, sub2 = 0;
    int lb1 = 0, ub1 = 0, lb2 = 0, ub2 = 0;
    for (int i = 0; i < numberOfVariables_; i++) {
      z[i] = x[i] / (2 * i + 2);
    }
    for (int i = 0; i < numberOfVariables_ - 1; i++) {
      sub1 = 0;
      for (int j = i + 1; j < numberOfVariables_; j++) {
        sub1 += z[j];
      }
      sub2 = sub1 / (numberOfVariables_ - i - 1);
      t1[i] = Math.pow(z[i], 0.02 + 49.98 * (0.98 / 49.98 - (1 - 2 * sub2) * Math
          .abs(Math.floor(0.5 - sub2) + 0.98 / 49.98)));
    }
    t1[numberOfVariables_ - 1] = z[numberOfVariables_ - 1];

    for (int i = 0; i < K12; i++) {
      t2[i] = 1 + (Math.abs(t1[i] - 0.35) - 0.001) * (349.95 * Math.floor(t1[i] - 0.349) / 0.349
          + 649.95 * Math.floor(0.351 - t1[i]) / 0.649 + 1000);
    }
    for (int i = K12; i < numberOfVariables_; i++) {
      t2[i] = 1.0 / 97 * (1 + Math.cos(
          122 * Math.PI * (0.5 - Math.abs(t1[i] - 0.35) * 0.5 / (Math.floor(0.35 - t1[i]) + 0.35)))
          + 380 * Math.pow(Math.abs(t1[i] - 0.35) * 0.5 / (Math.floor(0.35 - t1[i]) + 0.35), 2));
    }
    int p = 0, h = 0;
    double sub3 = 0, sub4 = 0;
    sub1 =
        Math.ceil(0.5 * K12 / (numberOfObjectives_ - 1)) * (1 + 2 * K12 / (numberOfObjectives_ - 1)
            - 2 * Math.ceil(0.5 * K12 / (numberOfObjectives_ - 1)));
    sub2 = Math.ceil(L12 / 2.0) * (1 + 2 * (L12) - 2 * Math.ceil(L12 / 2.0));
    lb2 = 0;
    ub2 = K12 / (numberOfObjectives_ - 1) - 2;
    for (int i = 0; i < numberOfObjectives_ - 1; i++) {
      sub4 = 0;
      lb1 = i * K12 / (numberOfObjectives_ - 1) + 1;
      ub1 = (i + 1) * K12 / (numberOfObjectives_ - 1);
      for (int j = lb1 - 1; j < ub1; j++) {
        h = lb2;
        sub3 = 0;
        while (h <= ub2) {
          p = lb1 + (j - lb1 + 1 + h) % (K12 / (numberOfObjectives_ - 1));
          sub3 += Math.abs(t2[j] - t2[p - 1]);
          h++;
        }
        sub4 += t2[j] + sub3;
      }
      t3[i] = sub4 / sub1;
    }
    lb1 = K12 + 1;
    ub1 = numberOfVariables_;
    lb2 = 0;
    ub2 = L12 - 2;
    sub3 = 0;
    sub4 = 0;
    for (int j = lb1 - 1; j < ub1; j++) {
      for (h = j + 1; h < K12 + L12; h++) {
        sub3 += Math.abs(t2[j] - t2[h]);
      }
      sub4 += t2[j];
    }

    sub4 += (sub3 * 2);
    t3[numberOfObjectives_ - 1] = sub4 / sub2;
    for (int i = 0; i < numberOfObjectives_ - 1; i++) {
      y[i] = (t3[i] - 0.5) * Math.max(1, t3[numberOfObjectives_ - 1]) + 0.5;
    }
    y[numberOfObjectives_ - 1] = t3[numberOfObjectives_ - 1];

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

    for (int i = 0; i < numberOfObjectives_; i++) {
      solution.setObjective(i, f[i]);
    }
  }
196053
def eval(self):
        
        Expr.ignore = False
        result = self.try_eval()
        Expr.ignore = True

        return result
125622
def evaluate(self, m):
        """"""

        g = m.groupdict()
        if g["strings"]:
            self.evaluate_strings(g)
            self.line_num += g['strings'].count('\n')
        elif g["code"]:
            self.line_num += g["code"].count('\n')
        else:
            if g['block']:
                self.evaluate_block(g)
            elif g['start'] is None:
                self.evaluate_inline_tail(g)
            else:
                self.evaluate_inline(g)
            self.line_num += g['comments'].count('\n')
637847
@Override
	public Object evaluate(Message message) throws JMSException
    {
        String[] values = new String[items.length];
        for (int n = 0 ; n < items.length ; n++)
            values[n] = items[n].evaluateString(message);
        
        return values;
    }
913304
public void evaluate(Tree guess, Tree gold, PrintWriter pw) {
    evaluate(guess, gold, pw, 1.0);
  }
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]);        
  }
1066601
@Override
	public Object evaluate(Message message) throws JMSException
    {
        String leftValue = leftOperand.evaluateString(message);
        String[] rightValue = (String[])rightOperand.evaluate(message);
        if (leftValue == null)
        	return null; // [JMS Spec]

        // Look for a match
        for (int n = 0 ; n < rightValue.length ; n++)
        	if (rightValue[n] != null && leftValue.equals(rightValue[n]))
        		return Boolean.TRUE;
        
        return Boolean.FALSE;
    }
414371
@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;
    result = testFunction.f(x);

    solution.setObjective(0, result);
  }
322012
@Override
  public void evaluate(IntegerSolution solution) {
    int approximationToN;
    int approximationToM ;

    approximationToN = 0;
    approximationToM = 0;

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

    solution.setObjective(0, approximationToN);
    solution.setObjective(1, approximationToM);
  }
614886
@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 J,y,sub1,sub2,sub3,sub4
    double[] y = new double[numberOfVariables_];
    for (int i = 0; i < numberOfVariables_; i++) {
      y[i] =
          x[i] - 2 * x[1] * Math.sin(2 * Math.PI * x[0] + (i + 1) * Math.PI / numberOfVariables_);
    }
    ArrayList<Integer> J1 = new ArrayList<Integer>();
    ArrayList<Integer> J2 = new ArrayList<Integer>();
    ArrayList<Integer> J3 = new ArrayList<Integer>();
    ArrayList<Integer> J4 = new ArrayList<Integer>();
    double sub1 = 0, sub2 = 0, sub3 = 0, sub4 = 0;
    for (int i = 4; i <= numberOfVariables_; i = i + 3) {
      J1.add(i);
      sub1 += Math.pow(y[i - 1], 2);
    }
    sub1 = 2 * sub1 / J1.size();
    for (int i = 5; i <= numberOfVariables_; i = i + 3) {
      J2.add(i);
      sub2 += Math.pow(y[i - 1], 2);
    }
    sub2 = 2 * sub2 / J2.size();
    for (int i = 3; i <= numberOfVariables_; i = i + 3) {
      J3.add(i);
      sub3 += Math.pow(y[i - 1], 2);
    }
    sub3 = 2 * sub3 / J3.size();
    for (int i = 4; i <= numberOfVariables_; i++) {
      J4.add(i);
      sub4 += Math.pow(y[i - 1], 2);
    }
    sub4 = 2 * sub4 / J4.size();
    // evaluate f1,f2,f3,f4,...m
    f[0] = Math.sin(Math.PI * x[0] / 2) + sub1;
    f[1] = Math.cos(Math.PI * x[0] / 2) * Math.sin(Math.PI * x[1] / 2) + sub2;
    f[2] = Math.cos(Math.PI * x[0] / 2) * Math.cos(Math.PI * x[1] / 2) + sub3;
    for (int i = 3; i < numberOfObjectives_; i++) {
      f[i] = Math.pow(f[0], 2) + Math.pow(f[1], 10) + Math.pow(f[2], 10) + sub4;
    }

    for (int i = 0; i < numberOfObjectives_; i++) {
      solution.setObjective(i, f[i]);
    }
  }
463112
@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);
    }
    double g = 0;
    // evaluate g
    for (int i = numberOfObjectives - 1; i < numberOfVariables; i++) {
      g += Math.pow(x[i] - 0.5, 2);
    }
    double subf1 = 1, subf3 = 1 + g;
    // evaluate fm,fm-1,...2,f1
    f[numberOfObjectives - 1] =
        2 * Math.pow(Math.sin(Math.PI * Math.pow(x[0], 100) / 2) * subf3, 1);
    // fi=2^i*(subf1*subf2)*(subf3)
    for (int i = numberOfObjectives - 2; i > 0; i--) {
      subf1 *= Math.cos(Math.PI * Math.pow(x[numberOfObjectives - i - 2], 100) / 2);
      f[i] = const5[numberOfObjectives - i - 1] * Math.pow(
          subf1 * Math.sin(Math.PI * Math.pow(x[numberOfObjectives - i - 1], 100) / 2) * subf3, 1);
    }
    f[0] = const5[numberOfObjectives - 1] * Math
        .pow(subf1 * (Math.cos(Math.PI * Math.pow(x[numberOfObjectives - 2], 100) / 2)) * subf3,
            1);

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

  }
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);
        }
    }