/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BasketOption.java
final RandomVariable monteCarloWeightsAtEvalTime = model.getMonteCarloWeights( evaluationTime) ;final RandomVariable numeraireAtMaturity = model.getNumeraire( maturity) ;
final RandomVariable numeraireAtMaturity = model.getNumeraire ( maturity ) ;
RandomVariable values = model.getRandomVariableForConstant(0.0); for(int underlyingIndex = 0; underlyingIndex<weights.length; underlyingIndex++) { final RandomVariable underlyingAtMaturity = model.getAssetValue(maturity, underlyingIndex); values = values.addProduct(underlyingAtMaturity, weights[underlyingIndex]); } values = values.sub(strike).floor(0.0); <extra_id_0> final RandomVariable monteCarloWeights = model.getMonteCarloWeights(maturity); values = values.div(numeraireAtMaturity).mult(monteCarloWeights); final RandomVariable numeraireAtEvalTime = model.getNumeraire(evaluationTime); final RandomVariable monteCarloWeightsAtEvalTime = model.getMonteCarloWeights(evaluationTime); values = values.mult(numeraireAtEvalTime).div(monteCarloWeightsAtEvalTime); return values;