I looked into your definition. I’m not sure what your aim is. But if you assign new elements to the most attractive location, the algorithm will always choose the same location until something changed. In your case, you always select the same location and restrict the assignment of new functions by the max density setting. That’s why you cannot add new functions. This was avoided by the randomness of the roulette wheel in before.
To help you, you need to describe what you’d like to do and what the problem is in detail.