/src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java
final RandomVariable periodCashFlowFix = model.getMonteCarloWeights( valuationTime) .div( numeraireAtPayment).mult( monteCarloProbabilitiesAtPayment) ;
final RandomVariable periodCashFlowFix = model.getRandomVariableForConstant ( swaprate * periodLength * notional ) .div ( numeraireAtPayment ) .mult ( monteCarloProbabilitiesAtPayment ) ;
final double fixingTime = FloatingpointDate.getFloatingPointDateFromDate(model.getReferenceDate().toLocalDate(), legSchedule.getPeriod(periodIndex).getFixing()); final double paymentTime = FloatingpointDate.getFloatingPointDateFromDate(model.getReferenceDate().toLocalDate(), legSchedule.getPeriod(periodIndex).getPayment()); final double periodLength = legSchedule.getPeriodLength(periodIndex); final RandomVariable numeraireAtPayment = model.getNumeraire(paymentTime); final RandomVariable monteCarloProbabilitiesAtPayment = model.getMonteCarloWeights(paymentTime); if(swaprate != 0.0) { <extra_id_0> value = value.add(periodCashFlowFix); } if(paysFloat) { final RandomVariable libor = model.getForwardRate(fixingTime, fixingTime, paymentTime); final RandomVariable periodCashFlowFloat = libor.mult(periodLength).mult(notional).div(numeraireAtPayment).mult(monteCarloProbabilitiesAtPayment); value = value.add(periodCashFlowFloat);