@Override
    public void generateCells(int numCells, TestingParameters parameters, ArrayList<NetworkCell> existingCells)
    {	
		if(!existingCells.isEmpty()) // add a bit smarter (based on affinities)
		{
			affThreshold = calcThreshold(existingCells, parameters);
			affDecay = calcDecay(existingCells, parameters);
			int nrAttempts = 0;
			for(int j=0; j<numCells; j++)
			{
				double[] dimensions = new double[parameters.numDims];
				
				for (int i = 0; i < parameters.numDims; i++)
				{
					dimensions[i] = parameters.lowerBounds[i] + (parameters.upperBounds[i] - parameters.lowerBounds[i]) * random.nextDouble();
				}
				NetworkCell cell = new NetworkCell(dimensions, parameters);
				if(isAllowed(cell, existingCells, parameters))
				{
					existingCells.add(cell);
					nrAttempts = 0;
				}
				else
				{
					j--;
					nrAttempts += 1;
					if(nrAttempts >= maxAttempts)
					{
						affThreshold = affThreshold + affDecay;
					}
				}
			}
		}
		else // add randomly
		{
			for(int j=0; j<numCells; j++)
			{
				double[] dimensions = new double[parameters.numDims];
				
				for (int i = 0; i < parameters.numDims; i++)
				{
					dimensions[i] = parameters.lowerBounds[i] + (parameters.upperBounds[i] - parameters.lowerBounds[i]) * random.nextDouble();
				}
				
				existingCells.add(new NetworkCell(dimensions, parameters));
			}
		}
		
    }