Home Forums Urban Modeling and Simulation attractivity map – alternatives to roulette wheel Reply To: attractivity map – alternatives to roulette wheel

#9578
Reinhard Koenig
Keymaster

Dear Martina,

for selecting the most attractive location (I assume that is meant with “nearest best placement”) you can use this code instead of the roulette wheel:

// — select the location with the highest attractivity —
double tempBest = 0;
for(int k = 0; k < AttractPop.Count; k++)
{
tempBest = AttractPop.Max();
slot = AttractPop.IndexOf(tempBest, 0);
}

The peaks in the plot show that the selection prefers for a while only one location.

Best regards

Reinhard