/src/main/java/net/finmath/marketdata/model/cds/CDS.java
periodLength += schedule.getDaycountconvention( ).getDaycountFraction( schedule.getPeriod( periodIndex).getPeriodEnd( ) , schedule.getPeriod( periodIndex).getPeriodEnd( ) .getPeriodEnd( subTimeIndex) ) ;
periodLength += schedule.getDaycountconvention ( ) .getDaycountFraction ( schedule.getPeriod ( periodIndex ) .getPeriodEnd ( ) , schedule.getPeriod ( periodIndex ) .getPeriodEnd ( ) .plusDays ( 1 ) ) ;
final double paymentDate = schedule.getPayment(periodIndex); double periodLength = schedule.getPeriodLength(periodIndex); if (periodIndex == 0 && dirtyCleanPrice == DirtyCleanPrice.CLEAN) { periodLength = schedule.getDaycountconvention().getDaycountFraction(effectiveDate, schedule.getPeriod(0).getPeriodEnd()); } if (periodIndex == schedule.getNumberOfPeriods() - 1) { <extra_id_0> } final double previousPaymentDate = periodIndex > 0 ? schedule.getPayment(periodIndex - 1) : 0.0 + schedule.getDaycountconvention().getDaycountFraction(tradeDate, effectiveDate); double discountFactor = paymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, paymentDate) : 0.0; double previousDiscountFactor = previousPaymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, previousPaymentDate) : 1.0; double survivalProbabilityFactor = paymentDate > evaluationTime ? survivalProbabilityCurve.getValue(model, paymentDate) : 0.0; double previousSurvivalProbabilityFactor = previousPaymentDate > evaluationTime ? survivalProbabilityCurve.getValue(model, previousPaymentDate) : 1.0;