Evaluates this Expression and returns the result.
481325
public Object evaluate()
  {
    if( !isCompileTimeConstant() )
    {
      return super.evaluate();
    }

    return (Boolean)getCondition().evaluate() ? getFirst().evaluate() : getSecond().evaluate();
  }
477956
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 (escapeXml_ != null) {
            Boolean b = (Boolean) ExpressionUtil.evalNotNull(
                    "out",
                    "escapeXml",
                    escapeXml_,
                    Boolean.class,
                    this,
                    pageContext);
            if (b == null) {
                escapeXml = false;
            } else {
                escapeXml = b.booleanValue();
            }
        }
    }
260098
public Object evaluate()
  {
    if( !isCompileTimeConstant() )
    {
      return super.evaluate();
    }

    Object value = getLHS().evaluate();

    IType argType = getType();

    if( value instanceof IType && argType instanceof IJavaType && JavaTypes.CLASS() == TypeLord.getPureGenericType( argType ) )
    {
      // Don't force class loading during compilation
      return value;
    }

    //============================================================================
    // Special Types
    // TODO cgross: remove these special cases (came from ParsedElement#convertValue)
    //              and allow the coercion manager to handle these cases
    //============================================================================
    if( argType == GosuParserTypes.NUMBER_TYPE() )
    {
      return CommonServices.getCoercionManager().makeDoubleFrom( value );
    }
    else if( argType == GosuParserTypes.STRING_TYPE() )
    {
      return CommonServices.getCoercionManager().makeStringFrom( value );
    }
    else if( argType == GosuParserTypes.DATETIME_TYPE() )
    {
      Date date = CommonServices.getCoercionManager().makeDateFrom( value );
      if ( date != null ) {
        return date;
      }
    }

    //============================================================================
    // This is really all we should be doing
    //============================================================================
    if( _coercer != null && (value != null || _coercer.handlesNull()) )
    {
      return _coercer.coerceValue( argType, value );
    }

    return value;
  }
772706
public final void evaluate() throws IOException {
    final ParserEvaluator evaluator = new ParserEvaluator(this.parser);
    evaluator.evaluate(this.testSamples);
    System.out.println(evaluator.getFMeasure());
  }
687518
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 = ExpressionEvaluatorManager.evaluate(
                    "value", value_, Object.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);
        }

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

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

        // 'groupingUsed' attribute
        if (groupingUsed_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "groupingUsed", groupingUsed_, Boolean.class, this,
                    pageContext);
            if (obj != null) {
                isGroupingUsed = ((Boolean) obj).booleanValue();
            }
        }

        // 'maxIntegerDigits' attribute
        if (maxIntegerDigits_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "maxIntegerDigits", maxIntegerDigits_, Integer.class, this,
                    pageContext);
            if (obj != null) {
                maxIntegerDigits = ((Integer) obj).intValue();
            }
        }

        // 'minIntegerDigits' attribute
        if (minIntegerDigits_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "minIntegerDigits", minIntegerDigits_, Integer.class, this,
                    pageContext);
            if (obj != null) {
                minIntegerDigits = ((Integer) obj).intValue();
            }
        }

        // 'maxFractionDigits' attribute
        if (maxFractionDigits_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "maxFractionDigits", maxFractionDigits_, Integer.class, this,
                    pageContext);
            if (obj != null) {
                maxFractionDigits = ((Integer) obj).intValue();
            }
        }

        // 'minFractionDigits' attribute
        if (minFractionDigits_ != null) {
            obj = ExpressionEvaluatorManager.evaluate(
                    "minFractionDigits", minFractionDigits_, Integer.class, this,
                    pageContext);
            if (obj != null) {
                minFractionDigits = ((Integer) obj).intValue();
            }
        }
    }
650746
@Override
  public void evaluate(DoubleSolution solution) {
    double [] fx = new double[2] ;
    double [] x = new double[getNumberOfVariables()] ;
    for (int i = 0 ; i < getNumberOfVariables(); i++)
    	x[i] = solution.getVariableValue(i) ;
    
    fx[0] = l *(2*x[0]+ Math.sqrt(2.0)*x[1]+ Math.sqrt(x[2])+x[3]) ;
    fx[1] = (f * l / e)*(2/x[0] + 2*Math.sqrt(2)/x[1] - 2*Math.sqrt(2)/x[2] + 2/x[3]);
    
    solution.setObjective(0,fx[0]);
    solution.setObjective(1,fx[1]);
  }
358463
private RLSupplier<Value> evaluate() {
		/* check if is there something to evaluate */
        if (stackRPN.empty()) {
            return () -> new StringValue("");
        }

		/* clean answer stack */
        stackAnswer.clear();

		/* get the clone of the RPN stack for further evaluating */
        @SuppressWarnings("unchecked")
        Stack stackRPN = (Stack) this.stackRPN.clone();

		/* evaluating the RPN expression */
        while (!stackRPN.empty()) {
            Object token = stackRPN.pop();
            if (token instanceof Value) {
                stackAnswer.push( (RLSupplier) ()->token );
            } else if (token instanceof Operator) {
                int arity = ((Operator) token).getArity();
                if ( arity == 2 ) {
                    RLSupplier a = (RLSupplier) stackAnswer.pop();
                    RLSupplier b = (RLSupplier) stackAnswer.pop();
                    stackAnswer.push( ((Operator) token).getEval(a,b));
                } else { // assume 1
                    RLSupplier a = (RLSupplier) stackAnswer.pop();
                    stackAnswer.push( ((Operator) token).getEval(a,null));
                }
            } else if (token instanceof VarPath) {
                VarPath vp = (VarPath) token;
                stackAnswer.push( vp.getEval() );
            } else if (token instanceof FuncOperand) {
                FuncOperand func = (FuncOperand) token;
                RLSupplier<Value> args[] = new RLSupplier[func.getArity()];
                for (int i = 0; i < args.length; i++) {
                    args[args.length-i-1] = ((RLSupplier<Value>)stackAnswer.pop());
                }
                stackAnswer.push(func.getEval(args));
            }
        }

        if (stackAnswer.size() > 1) {
            throw new QParseException("Some operator is missing");
        }

        return (RLSupplier<Value>) stackAnswer.pop();
    }
415921
protected function evalExpression()
    {
        $this->log("Evaluating PHP expression: " . $this->expression, $this->logLevel);
        if (!StringHelper::endsWith(';', trim($this->expression))) {
            $this->expression .= ';';
        }

        if ($this->returnProperty !== null) {
            $retval = null;
            eval('$retval = ' . $this->expression);
            $this->project->setProperty($this->returnProperty, $retval);
        } else {
            eval($this->expression);
        }
    }
1329716
@Override
  public void evaluate(DoubleSolution solution) {
    double [] f = new double[getNumberOfObjectives()];
    f[0] = solution.getVariableValue(0) ;
    f[1] = (1.0 + solution.getVariableValue(1))/solution.getVariableValue(0);
    
    solution.setObjective(0,f[0]);
    solution.setObjective(1,f[1]);

    this.evaluateConstraints(solution);
  }
1340567
@Override
  public void evaluate(DoubleSolution solution)  {
    double[] f = new double[solution.getNumberOfVariables()];

    double x1 = solution.getVariableValue(0);
    double x2 = solution.getVariableValue(1);
    f[0] = 2.0 + (x1 - 2.0) * (x1 - 2.0) + (x2 - 1.0) * (x2 - 1.0);
    f[1] = 9.0 * x1 - (x2 - 1.0) * (x2 - 1.0);

    solution.setObjective(0, f[0]);
    solution.setObjective(1, f[1]);

    this.evaluateConstraints(solution);
  }
1079597
@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, subf1 = 1, subf3;
    for (int j = numberOfObjectives - 1; j < numberOfVariables; j++) {
      g += (Math.pow(x[j] - 0.5, 2));
    }
    subf3 = 1 + g;

    f[numberOfObjectives - 1] = x[0] * subf3;
    for (int i = numberOfObjectives - 2; i > 0; i--) {
      subf1 *= x[numberOfObjectives - i - 2];
      f[i] = subf3 * (1 - subf1 * (1 - x[numberOfObjectives - i - 1]));
    }
    f[0] = (1 - subf1 * x[numberOfObjectives - 2]) * subf3;

    for (int i = 0; i < numberOfObjectives; i++) {
      solution.setObjective(i, f[i]);
    }
  }
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);
        }
    }
951692
public static boolean evaluate(final String expression) {
        final Deque<String> operators = new ArrayDeque<>();
        final Deque<String> values = new ArrayDeque<>();
        final boolean result;

        char currentCharacter;
        int currentCharacterIndex = 0;

        try {
            while (currentCharacterIndex < expression.length()) {
                currentCharacter = expression.charAt(currentCharacterIndex);

                if (SeparatorToken.OPEN_PARENTHESIS.value == currentCharacter) {
                    operators.push(SeparatorToken.OPEN_PARENTHESIS.toString());
                    currentCharacterIndex += moveCursor(SeparatorToken.OPEN_PARENTHESIS.toString());
                } else if (SeparatorToken.SPACE.value == currentCharacter) {
                    currentCharacterIndex += moveCursor(SeparatorToken.SPACE.toString());
                } else if (SeparatorToken.CLOSE_PARENTHESIS.value == currentCharacter) {
                    evaluateSubexpression(operators, values);
                    currentCharacterIndex += moveCursor(SeparatorToken.CLOSE_PARENTHESIS.toString());
                } else if (!Character.isDigit(currentCharacter)) {
                    final String parsedNonDigit = parseNonDigits(expression, currentCharacterIndex);
                    if (isBoolean(parsedNonDigit)) {
                        values.push(replaceBooleanStringByIntegerRepresentation(parsedNonDigit));
                    } else {
                        operators.push(validateOperator(parsedNonDigit));
                    }
                    currentCharacterIndex += moveCursor(parsedNonDigit);
                } else if (Character.isDigit(currentCharacter)) {
                    final String parsedDigits = parseDigits(expression, currentCharacterIndex);
                    values.push(parsedDigits);
                    currentCharacterIndex += moveCursor(parsedDigits);
                }
            }

            result = Boolean.valueOf(evaluateExpressionStack(operators, values));

            if (log.isDebugEnabled()) {
                log.debug("Boolean expression {} evaluates to {}", expression, result);
            }
        } catch (final NoSuchElementException e) {
            throw new CitrusRuntimeException("Unable to parse boolean expression '" + expression + "'. Maybe expression is incomplete!", e);
        }

        return result;
    }
749541
def evaluate(self, expression, processorNss=None):
        '''
        '''
        from Ft.Xml import XPath
        if not processorNss:
            context = XPath.Context.Context(self.node, processorNss=self.processorNss)
        else:
            context = XPath.Context.Context(self.node, processorNss=processorNss)
        nodes = expression.evaluate(context)
        return map(lambda node: ElementProxy(self.sw,node), nodes)
1339330
public <T extends Evaluation> T evaluate(DataSetIterator iterator) {
        return (T)evaluate(iterator, null);
    }
797120
function evaluate() {
        if ($this->_nfx == false) {
            return false;
        }
        $res = $this->_em->pfx($this->_nfx);
        if ($res === false) {
            $this->_error = $this->_em->last_error;
            return false;
        } else {
            $this->_error = false;
            return $res;
        }
    }
276727
public function evaluateResult()
	{
		// Check the variable set is not all fallback values
		$factsFallback = $this->factVariableBindings && ! count( array_filter( $this->factVariableBindings,
			function( /** @var VariableBinding $variableBinding */ $variableBinding )
			{
				return ! $variableBinding->isFallback;
			} )
		);

		// $generalsFallback =  $this->generalVariableBindings && ! count( array_filter( $this->generalVariableBindings,
		// 	function( /** @var VariableBinding $variableBinding */ $variableBinding )
		// 	{
		// 		return ! $variableBinding->isFallback;
		// 	} )
		// );

		if ( $factsFallback /* && $generalsFallback */ )
		{
			return false;

			$msg = "All facts have fallback values";
			\XBRL_Log::getInstance()->formula_validation( "Variable set evaluation", $msg, array(
				'variable set' => get_called_class()
			) );

			throw new \Exception( $msg );
		}

		// Check preconditions
		if ( ! $this->preconditions )
		{
			return true;
		}

		foreach ( $this->preconditions as $precondition )
		{
			try
			{
				$vars = $this->getBindingsAsVars();
				$result = $this->evaluateXPathExpression( $this, $precondition->testXPathExpression, $vars );
				// The pre-condition result should be true or false and only true will allow the evaluation to be counted
				if ( ! $result instanceof CoreFuncs::$True )
				{
					if ( ! $result instanceof CoreFuncs::$False )
					{
						throw XPath2Exception::withErrorCodeAndParam( "FORG0006", "The precondition with label '{0}' did not return a boolean result", $precondition->label );
					}

					return false;
				}
			}
			catch( XPath2Exception $ex )
			{
				throw $ex;
			}
			catch( \Exception $ex )
			{
				throw $ex;
			}
		}

		return true;
	}