public static double getSwapAnnuity(double evaluationTime, ScheduleInterface schedule, DiscountCurveInterface discountCurve, AnalyticModelInterface model) {
		double value = 0.0;
		for(int periodIndex=0; periodIndex<schedule.getNumberOfPeriods(); periodIndex++) {
			double paymentDate		= schedule.getPayment(periodIndex);
			if(paymentDate <= evaluationTime) {
				continue;
			}

			double periodLength		= schedule.getPeriodLength(periodIndex);
			double discountFactor	= discountCurve.getDiscountFactor(model, paymentDate);
			value += periodLength * discountFactor;
		}
		return value / discountCurve.getDiscountFactor(model, evaluationTime);
	}
public static double getSwapAnnuity ( double evaluationTime , ScheduleInterface schedule , DiscountCurveInterface discountCurve , AnalyticModelInterface model ) { double value = 0.0 ; for ( int periodIndex = 0 ; periodIndex < schedule . getNumberOfPeriods ( ) ; periodIndex ++ ) { double paymentDate = schedule . getPayment ( periodIndex ) ; if ( paymentDate <= evaluationTime ) { continue ; } double periodLength = schedule . getPeriodLength ( periodIndex ) ; double discountFactor = discountCurve . getDiscountFactor ( model , paymentDate ) ; value += periodLength * discountFactor ; } return value / discountCurve . getDiscountFactor ( model , evaluationTime ) ; }
Function to calculate an (idealized) swap annuity for a given schedule and discount curve.

Note that, the value returned is divided by the discount factor at evaluation.
This matters, if the discount factor at evaluationTime is not equal to 1.0.

@param evaluationTime The evaluation time as double. Cash flows prior and including this time are not considered.
@param schedule The schedule discretization, i.e., the period start and end dates. End dates are considered payment dates and start of the next period.
@param discountCurve The discount curve.
@param model The model, needed only in case the discount curve evaluation depends on an additional curve.
@return The swap annuity.