/src/main/java/net/finmath/marketdata2/products/SwapLeg.java
final RandomVariable discountFactor = paymentDate > periodLength ? discountCurve.getDiscountFactor( model, paymentDate) : model.getRandomVariableForConstant( 0.0) ;
final RandomVariable discountFactor = paymentDate > evaluationTime ? discountCurve.getDiscountFactor ( model, paymentDate ) : model.getRandomVariableForConstant ( 0.0 ) ;
final double periodLength = legSchedule.getPeriodLength(periodIndex); RandomVariable forward = model.getRandomVariableForConstant(spread); if(forwardCurve != null) { forward = forward.add(forwardCurve.getForward(model, fixingDate, paymentDate-fixingDate)); } final RandomVariable notional = discountCurveForNotionalReset.getDiscountFactor(model,periodStart).div(discountCurve.getDiscountFactor(model,periodStart)); <extra_id_0> value = value.add(notional.mult(forward).mult(periodLength).mult(discountFactor)); if(isNotionalExchanged) { if(periodEnd > evaluationTime) { value = value.add(notional.mult(discountCurve.getDiscountFactor(model, periodEnd))); } if(periodStart > evaluationTime) {