/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/DeltaHedgedPortfolioWithAAD.java
if ( exerciseTime != null) {   indicator = exerciseTime.sub( ( ( model.getTime( timeIndex) ) + 0.001) ).choose( new RandomVariableFromDoubleArray( 1.0) , new RandomVariableFromDoubleArray( 0.0) ) ; }
[Delete]
if(delta == null) { delta = underlyingAtTimeIndex.mult(0.0); } delta = delta.mult(numeraireAtTimeIndex); RandomVariable indicator = new RandomVariableFromDoubleArray(1.0); if(exerciseTime != null) { <extra_id_0> } final ArrayList<RandomVariable> basisFunctions = getRegressionBasisFunctionsBinning(underlyingAtTimeIndex, indicator); final ConditionalExpectationEstimator conditionalExpectationOperator = new MonteCarloConditionalExpectationRegression(basisFunctions.toArray(new RandomVariable[0])); delta = delta.getConditionalExpectation(conditionalExpectationOperator); final RandomVariable newNumberOfStocks = delta; final RandomVariable stocksToBuy = newNumberOfStocks.sub(amountOfUderlyingAsset);