/src/main/java/net/finmath/montecarlo/interestrate/products/FlexiCap.java
final RandomVariable monteCarloProbabilities = model.getMonteCarloWeights( model.getTimeIndex( strike) ) ;
final RandomVariable monteCarloProbabilities = model.getMonteCarloWeights ( model.getTimeIndex ( paymentDate ) ) ;
continue; } final double strike = strikes[period]; final double periodLength = paymentDate - fixingDate; final RandomVariable libor = model.getForwardRate(fixingDate, fixingDate, paymentDate); final RandomVariable numeraire = model.getNumeraire(paymentDate); <extra_id_0> RandomVariable payoff = libor.sub(strike).mult(periodLength); RandomVariable indicator = payoff.choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0)); indicator = numberOfExcercises.choose(indicator, new Scalar(0.0)); payoff = payoff.div(numeraire).mult(monteCarloProbabilities); values = values.addProduct(indicator, payoff); numberOfExcercises = numberOfExcercises.sub(indicator);