/**
* Test the Ratchet present value in the degenerate case where the coupon are fixed (floor=cap).
*/
public void presentValueFixedLeg() {
final int nbPath = 12500;
final LiborMarketModelMonteCarloMethod methodMC = new LiborMarketModelMonteCarloMethod(new NormalRandomNumberGenerator(0.0, 1.0, new MersenneTwister()), nbPath);
final double[] mainFixed = new double[] {0.0, 0.0, 0.0};
final double[] floorFixed = new double[] {0.0, 0.0, FIRST_CPN_RATE};
final double[] capFixed = new double[] {0.0, 0.0, FIRST_CPN_RATE};
final AnnuityCouponIborRatchetDefinition ratchetFixedDefinition = AnnuityCouponIborRatchetDefinition.withFirstCouponFixed(SETTLEMENT_DATE, ANNUITY_TENOR, NOTIONAL, EURIBOR3M, IS_PAYER,
FIRST_CPN_RATE, mainFixed, floorFixed, capFixed, TARGET);
final AnnuityCouponIborRatchet ratchetFixed = ratchetFixedDefinition.toDerivative(REFERENCE_DATE, FIXING_TS);
final AnnuityCouponFixedDefinition fixedDefinition = AnnuityCouponFixedDefinition.from(EUR, SETTLEMENT_DATE, ANNUITY_TENOR, EURIBOR3M.getTenor(), TARGET, EURIBOR3M.getDayCount(),
EURIBOR3M.getBusinessDayConvention(), EURIBOR3M.isEndOfMonth(), NOTIONAL, FIRST_CPN_RATE, IS_PAYER);
final AnnuityCouponFixed fixed = fixedDefinition.toDerivative(REFERENCE_DATE);
final MultipleCurrencyAmount pvFixedExpected = fixed.accept(PVDC, MULTICURVES);
final MultipleCurrencyAmount pvFixedMC = methodMC.presentValue(ratchetFixed, EUR, LMM_MULTICURVES);
assertEquals("Annuity Ratchet Ibor - LMM - Monte Carlo - Degenerate in Fixed leg", pvFixedExpected.getAmount(EUR), pvFixedMC.getAmount(EUR), TOLERANCE_PV_MC);
// For 500,000 path the difference is xxx
}