docs: public static RandomVariable getValueOfLegAnalytic(double evaluationTime, LIBORModelMonteCarloSimulationModel model, Schedule schedule, boolean paysFloatingRate, double fixRate, double notional) throws CalculationException {
  
  		LocalDate modelReferenceDate = null;
  		try {
  			modelReferenceDate = model.getReferenceDate().toLocalDate();
  			if(modelReferenceDate == null) {
  				modelReferenceDate = schedule.getReferenceDate();
  			}
  		}
  		catch(UnsupportedOperationException e) {}
  
  		RandomVariable discountedCashflowFloatingLeg	= model.getRandomVariableForConstant(0.0);
  		for(int peridIndex = schedule.getNumberOfPeriods() - 1; peridIndex >= 0; peridIndex--) {
  			Period period = schedule.getPeriod(peridIndex);
  			double paymentTime		= FloatingpointDate.getFloatingPointDateFromDate(modelReferenceDate, period.getPayment());
  			double fixingTime		= FloatingpointDate.getFloatingPointDateFromDate(modelReferenceDate, period.getFixing());
  			double periodLength		= schedule.getPeriodLength(peridIndex);
  
  			/*
  			 * Note that it is important that getForwardDiscountBond and getLIBOR are called with evaluationTime = exerciseTime.
  			 */
  			RandomVariable discountBond = model.getModel().getForwardDiscountBond(evaluationTime, paymentTime);
  			if(paysFloatingRate) {
  				RandomVariable libor	= model.getLIBOR(evaluationTime, fixingTime, paymentTime);
  				RandomVariable periodCashFlow = libor.mult(periodLength).mult(notional);
  				discountedCashflowFloatingLeg = discountedCashflowFloatingLeg.add(periodCashFlow.mult(discountBond));
  			}
  			if(fixRate != 0) {
  				RandomVariable periodCashFlow = model.getRandomVariableForConstant(fixRate * periodLength * notional);
  				discountedCashflowFloatingLeg = discountedCashflowFloatingLeg.add(periodCashFlow.mult(discountBond));
  			}
  		}
  		return discountedCashflowFloatingLeg;
  
  	}