Returns the value of this product under the given model.

@param evaluationTime Evaluation time.
@param model The model.
@return Value of this product und the given model.
553712
public double getValueAsPrice(double evaluationTime, AnalyticModel model) {
		ForwardCurve	forwardCurve	= model.getForwardCurve(forwardCurveName);
		DiscountCurve	discountCurve	= model.getDiscountCurve(discountCurveName);

		DiscountCurve	discountCurveForForward = null;
		if(forwardCurve == null && forwardCurveName != null && forwardCurveName.length() > 0) {
			// User might like to get forward from discount curve.
			discountCurveForForward	= model.getDiscountCurve(forwardCurveName);

			if(discountCurveForForward == null) {
				// User specified a name for the forward curve, but no curve was found.
				throw new IllegalArgumentException("No curve of the name " + forwardCurveName + " was found in the model.");
			}
		}

		double value = 0.0;
		for(int periodIndex=0; periodIndex<schedule.getNumberOfPeriods(); periodIndex++) {
			double fixingDate	= schedule.getFixing(periodIndex);
			double paymentDate	= schedule.getPayment(periodIndex);
			double periodLength	= schedule.getPeriodLength(periodIndex);

			/*
			 * We do not count empty periods.
			 * Since empty periods are an indication for a ill-specified product,
			 * it might be reasonable to throw an illegal argument exception instead.
			 */
			if(periodLength == 0) {
				continue;
			}

			double forward = 0.0;
			if(forwardCurve != null) {
				forward			+= forwardCurve.getForward(model, fixingDate, paymentDate-fixingDate);
			}
			else if(discountCurveForForward != null) {
				/*
				 * Classical single curve case: using a discount curve as a forward curve.
				 * This is only implemented for demonstration purposes (an exception would also be appropriate :-)
				 */
				if(fixingDate != paymentDate) {
					forward			+= (discountCurveForForward.getDiscountFactor(fixingDate) / discountCurveForForward.getDiscountFactor(paymentDate) - 1.0) / (paymentDate-fixingDate);
				}
			}

			double discountFactor	= paymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, paymentDate) : 0.0;
			double payoffUnit = discountFactor * periodLength;

			double effektiveStrike = strike;
			if(isStrikeMoneyness) {
				effektiveStrike += getATMForward(model, true);
			}

			VolatilitySurface volatilitySurface	= model.getVolatilitySurface(volatiltiySufaceName);
			if(volatilitySurface == null) {
				throw new IllegalArgumentException("Volatility surface not found in model: " + volatiltiySufaceName);
			}
			if(volatilitySurface.getQuotingConvention() == QuotingConvention.VOLATILITYLOGNORMAL) {
				double volatility = volatilitySurface.getValue(model, fixingDate, effektiveStrike, VolatilitySurface.QuotingConvention.VOLATILITYLOGNORMAL);
				value += AnalyticFormulas.blackScholesGeneralizedOptionValue(forward, volatility, fixingDate, effektiveStrike, payoffUnit);
			}
			else {
				// Default to normal volatility as quoting convention
				double volatility = volatilitySurface.getValue(model, fixingDate, effektiveStrike, VolatilitySurface.QuotingConvention.VOLATILITYNORMAL);
				value += AnalyticFormulas.bachelierOptionValue(forward, volatility, fixingDate, effektiveStrike, payoffUnit);
			}
		}

		return value / discountCurve.getDiscountFactor(model, evaluationTime);
	}
1131852
public Object getValue(FacesContext context) throws EvaluationException,
            PropertyNotFoundException {
        if (context == null) {
	        throw new NullPointerException("FacesContext -> null");
        }
        Object result = null;
        try {
            result = valueExpression.getValue(context.getELContext());
        } catch (javax.el.PropertyNotFoundException pnfe) {
            throw new PropertyNotFoundException(pnfe);
        } catch (ELException elex) {
            throw new EvaluationException(elex);
        }
        return result;
    }
937054
@Override
	public Object evaluate( Message message ) throws JMSException
    {
        Boolean leftOperandValue = leftOperand.evaluateBoolean(message);
        if (leftOperandValue == null)
        {
            Boolean rightOperandValue = rightOperand.evaluateBoolean(message);
            if (rightOperandValue == null || !rightOperandValue.booleanValue())
                return null;
            
            return Boolean.TRUE;
        }
        else
        {
            if (leftOperandValue.booleanValue())
                return Boolean.TRUE;
            
            return rightOperand.evaluateBoolean(message);
        }
    }
947716
public Class getType(FacesContext context) throws MethodNotFoundException
    {
        try
        {
            return m.getMethodInfo(context.getELContext()).getReturnType();
        }
        catch (javax.el.MethodNotFoundException e)
        {
            throw new MethodNotFoundException(e.getMessage(), e.getCause());
        }
        catch (ELException e)
        {
            throw new EvaluationException(e.getMessage(), e.getCause());
        }
    }
479632
@Override
    public ModelService getModelService(String serviceName){
        ModelServiceClientCache cache = getCache().get(serviceName);
        ModelService lookup;
        if (cache == null) {
            // cache has not never been created, initialize an new one.
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("service has not been cached, try to cache the service {} ", serviceName);
            }
            lookup = super.getModelService(serviceName);
            if (lookup!=null) {
                getCache().putIfAbsent(serviceName, new ModelServiceClientCache(lookup));
                cache = getCache().get(serviceName);
                addInstanceChangeListener(serviceName, cache);
            }
        } else {
            // service cached has been removed
            if (cache.getData() == null) {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("cached service={} is obsoleted, try to get service from server", serviceName);
                }
                lookup = super.getModelService(serviceName);
                if (lookup != null) {
                    // replace old cached service by new one
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug("try to replace the obsoleted cached service={} by service from server {}", serviceName,lookup.getServiceInstances());
                    }
                    removeInstanceChangeListener(serviceName, cache);
                    boolean replaced = getCache().replace(serviceName, cache, new ModelServiceClientCache(lookup));
                    if (replaced) {
                        addInstanceChangeListener(serviceName, getCache().get(serviceName));

                    } else {
                        LOGGER.error("fail to replace the obsoleted cached service={}", serviceName);
                    }
                }else{
                    LOGGER.error("fail to lookup service={} from server",serviceName);
                }
            }
            // use the use cached service
            else {
                if (LOGGER.isDebugEnabled()) {
                    LOGGER.debug("service={} has been cached, get service from cache. {}", serviceName,cache.getData().getServiceInstances());
                }
                lookup = cache.getData();
            }
        }
        return lookup;
    }
110916
public double getPerformance(int evaluation) {
    if ((m_Metrics != null) && !m_Metrics.check(evaluation))
      return Double.NaN;

    if (!m_MetricValues.containsKey(evaluation))
      return Double.NaN;

    return m_MetricValues.get(evaluation);
  }
309252
def value(self, obj):
        '''
        
        '''
        if self.template_name:
            t = loader.select_template([self.template_name])
            return t.render(Context({'object': obj}))

        if self.eval_func:
            try:
                return eval(self.eval_func)
            except Exception as e:
                raise type(e)('Could not compute value of {} field (eval_as=`{}`): {}.'.format(unicode(self), self.eval_func, unicode(e)))

        elif self.model_attr:
            if isinstance(obj, dict):
                return obj[self.model_attr]
            current_obj = getattr(obj, self.model_attr)

            if callable(current_obj):
                return current_obj()
            else:
                return current_obj

        else:
            raise KeyError('{0} gets its value via a model attribute, an eval function, a template, or is prepared in a method '
                           'call but none of `model_attr`, `eval_as,` `template,` `prepare_{0}` is provided.'.format(unicode(self)))
1245715
public static Evaluation getEvaluation(ComputationGraph model, MultiDataSetIterator testData) {
        if (model.getNumOutputArrays() != 1)
            throw new IllegalStateException("GraphSetSetAccuracyScoreFunction cannot be "
                            + "applied to ComputationGraphs with more than one output. NumOutputs = "
                            + model.getNumOutputArrays());

        return model.evaluate(testData);
    }
533961
protected Map<String, Object> getModelAttributes(final Map<String, Object> model) {
        return (Map<String, Object>) model.get(CasProtocolConstants.VALIDATION_CAS_MODEL_ATTRIBUTE_NAME_ATTRIBUTES);
    }
722493
public function evaluate(Model $model)
    {
        $filter = false;

        if (!$model[$this->columnName] instanceof RhubarbDateTime) {
            $filter = true;
        } else {
            if (!in_array($model[$this->columnName]->format("N") - 1, $this->validDays)) {
                $filter = true;
            }
        }

        return $filter;
    }
555261
public Object evaluate()
  {
    if( !isCompileTimeConstant() )
    {
      return super.evaluate();
    }

    return evaluate( getType(), getLHS().evaluate(), getRHS().evaluate(), getLHS().getType(), getRHS().getType(), getOperator().charAt( 0 ), false );
  }
1157997
public Model getModel(MP params) {
    Key<Model> mKey = getModelKey(params);
    return mKey != null ? mKey.get() : null;
  }
831836
@RequestMapping(value = "/api/plugins/{id}/{className:.+}", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getClassInformation(Model model, @PathVariable Integer id, @PathVariable String className) {
        HashMap<String, Object> returnValues = new HashMap<String, Object>();

        try {
            returnValues.put("methods", PluginManager.getInstance().getMethods(className));
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return returnValues;
    }
386506
public Object eval(String expression) {
    	expression = transform(expression);
    	Object result = calculate(expression);
        return result;
    }
489469
public com.google.api.ads.admanager.axis.v201808.DateTime getEvaluationTime() {
        return evaluationTime;
    }
386238
@Override
    public Object evaluate(String expression, MuleMessage message) {
        String object = null;

        Integer deliveryCount;
        String jmsMessageId;

        if (message.getOriginalPayload() != null && message.getOriginalPayload() instanceof Message) {
            try {
                deliveryCount =
                    ((Message) message.getOriginalPayload()).getIntProperty(JmsConstants.JMS_X_DELIVERY_COUNT);
                jmsMessageId = ((Message) message.getOriginalPayload()).getStringProperty(JmsConstants.JMS_MESSAGE_ID);
            } catch (Exception e) {
                throw new RuntimeException("Failed to evaluate JMS message. Expression evaluator: " + expression, e);
            }
        } else {
            deliveryCount = message.getProperty(JmsConstants.JMS_X_DELIVERY_COUNT, PropertyScope.INVOCATION);
            jmsMessageId = message.getProperty(JmsConstants.JMS_MESSAGE_ID, PropertyScope.INVOCATION);
            if (deliveryCount == null || jmsMessageId == null) {
                throw new RuntimeException("Failed to evaluate JMS message. Expression evaluator: " + expression);
            }
        }

        LOGGER.debug("JMSMessageID: {}, JMSXDeliveryCount: {}", jmsMessageId, deliveryCount);

        if (EXPR_IS_EXHAUSTED.equals(expression)) {

            if (maxRedeliveries < deliveryCount) {
                LOGGER.warn("Exhausted! JMSMessageID: {}, JMSXDeliveryCount: {}", jmsMessageId, deliveryCount);
                return true;
            }
            return false;
        } else if (EXPR_IS_REDELIVERY.equals(expression)) {

            if (deliveryCount == 1) {
                return false;
            }
            return true;
        }
        return object;
    }
646824
@Override
	public Object evaluate( Message message ) throws JMSException
    {
        Boolean operandValue = operand.evaluateBoolean(message);
        if (operandValue == null)
            return null;
        
        return operandValue.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
    }