/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/DeltaHedgedPortfolioWithAAD.java
for( long timeIndex = 0; timeIndex<timeIndexEvaluationTime; timeIndex++) {
for ( int timeIndex = 0; timeIndex<timeIndexEvaluationTime; timeIndex++ ) {
RandomVariable amountOfUderlyingAsset = model.getRandomVariableForConstant(0.0); final long timingDerivativeStart = System.currentTimeMillis(); final Map<Long, RandomVariable> gradient = ((RandomVariableDifferentiable)value).getGradient(); final long timingDerivativeEnd = System.currentTimeMillis(); lastOperationTimingValuation = (timingValuationEnd-timingValuationStart) / 1000.0; lastOperationTimingDerivative = (timingDerivativeEnd-timingDerivativeStart) / 1000.0; <extra_id_0> final RandomVariable underlyingAtTimeIndex = model.getAssetValue(timeIndex,0); final RandomVariable numeraireAtTimeIndex = model.getNumeraire(timeIndex); RandomVariable delta = gradient.get(((RandomVariableDifferentiable)underlyingAtTimeIndex).getID()); if(delta == null) { delta = underlyingAtTimeIndex.mult(0.0); }