So, I have a procedurally generated planet. In my case it's 3D (hexagon/pentagon globe) but for simplicity let's assume it is a 2D grid.
I have distributed resources over this planet, using Simplex Noise, with a cut-off value, giving me a binary distribution.
One of the things I generate in this way, are fields of wheat, shown in yellow below.
After the wheat-fields are generated, I want to procedurally place farms on the planet.
If I would just randomly pick a "yellow tile" (tile with wheat on it) then I run the danger of having them poorly distributed, as shown on the left.
What I want, is a nice distribution where farms favour large wheat areas that are still unoccupied by other farms, as shown on the right.
Is there a simple algorithm that can do this placement?
NOTE: I want to use this approach for other buildings like mines, quarries, lumberjack operations, etc. So I want to avoid placing first, and then growing resources around it. I want the noise field to drive the placement, not the other way around.
NOTE: Farms will not consume the wheat. I've made wheat fields binary wheat/no-wheat but also have scaled distributions with "potency" for e.g. forests, where the number of trees per tile can vary.