@Override
	public double[] simulateBlockedOvershoot(AbstractStochasticLotSizingProblem problem,
			AbstractStochasticLotSizingSolution solution)
			throws ConvolutionNotDefinedException, SolvingInitialisiationException {
		
		//Check the inputs
		if (problem.getPeriods().length != solution.getAmountVariableValues().length)
			throw new SolvingInitialisiationException("The length of the problem and the solution do not match in StaticDynamicUncertaintySimulator solve");
		
		
		
		AbstractLotSizingPeriod[] periods = problem.getPeriods();
		boolean[] setupPattern = solution.getSetupPattern();
		double[] orderUpToLevel = solution.getAmountVariableValues();
		
		double CurrentInventory = 0.0; //Starting inventory
				double[] periodOvershoot = new double[periods.length];
		
		for (int i = 0; i < periods.length; i++){
			if (setupPattern[i]){
				if (CurrentInventory >= orderUpToLevel[i]) {
					periodOvershoot[i] = CurrentInventory - orderUpToLevel[i];
				}
				
				CurrentInventory = orderUpToLevel[i];
				
			}
			CurrentInventory -= periods[i].totalDemand().sample();
			
		}
		
		return periodOvershoot;
	}