/src/main/java/net/finmath/montecarlo/interestrate/products/Swaption.java
final DiscountCurve discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve( forwardCurve) ; final ForwardCurve forwardCurve = model.getModel( ).getForwardRateCurve( ) ;
final ForwardCurve forwardCurve = model.getModel ( ) .getForwardRateCurve ( ) ; final DiscountCurve discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve ( forwardCurve ) ;
final RandomVariable payoff = libor.sub(swaprate).mult(periodLength).mult(notional); final double discountingDate = Math.max(fixingDate,exerciseDate); double discountingAdjustment = 1.0; if(model.getModel() != null && model.getModel().getDiscountCurve() != null) { final AnalyticModel analyticModel = model.getModel().getAnalyticModel(); final DiscountCurve discountCurve = model.getModel().getDiscountCurve(); <extra_id_0> final double forwardBondOnForwardCurve = discountCurveFromForwardCurve.getDiscountFactor(analyticModel, discountingDate) / discountCurveFromForwardCurve.getDiscountFactor(analyticModel, paymentDate); final double forwardBondOnDiscountCurve = discountCurve.getDiscountFactor(analyticModel, discountingDate) / discountCurve.getDiscountFactor(analyticModel, paymentDate); discountingAdjustment = forwardBondOnForwardCurve / forwardBondOnDiscountCurve; } valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.add(payoff); valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, paymentDate - discountingDate).mult(discountingAdjustment);