The size of cities after map creation should follow Zipf's distribution.
http://www2.econ.uu.nl/users/marrewijk/geography/zipf/index.htm (http://www2.econ.uu.nl/users/marrewijk/geography/zipf/index.htm),
http://www.nslij-genetics.org/wli/zipf/ (http://www.nslij-genetics.org/wli/zipf/)
Inkelyad,
this looks very interesting, although I haven't had a chance to try it yet as I'm currently away from home. Looking at your patch, it doesn't seem that this is specific to Simutrans-Experimental, and could work equally well in Simutrans-Standard. I'll move the topic to the standard development and bug reports, patch releases folder so that the Standard developers can have a look at this one. I shall also have a look at it when I get the chance, if it hasn't already been slated for inclusion in Standard by then.
Edit: May I ask - how does it work for you when you test it?
The current generation is already 25000*mean_number/(simrand(20000)+100) (the 100 is just to avoid too large towns). Thus this is already close to said distribution.
Inkelyad,
do you notice a major difference in practice between the original version and your version when maps are generated?
In current implementation there is almost 10% chance city population will
be greater then mean_number * 10. When city number is 22 that means there is
only 10% chance map will have less then 7 such cities. It is way too often.
Zipf's distribution don't do that. It creates only one big city.
Inkelyad,
can you give some examples of the maps created with and without your patch - either in a table or with screenshots? It's hard to gauge the effect without a little more detail.
Prissi - in your opinion, is Inkelyad right about the difference in distribution between the model in this patch and that in Standard; and which do you think is closer to reality?
Sorry, my math was wrong. But current implementation really too often makes too big cities.
The maths in your patch, in your explanation of the patch, or both? Does that mean that we should not use your patch?
Math in explanation. I am wrong about "When city number is 22 that means there is
only 10% chance map will have less then 7 such cities".
In you link Zipf distribution is Pn = 1/n (when alpha=1 what should be often the case, according to the text.) That is exactly the code implemented in Simutrans.
The only difference is, that Pn is limited between 25*mean_number < generated number < 0.124 * mean_number. There is a 10% chance for a city larger than 1,19 than mean_number, and a 5% chance for 2.27*mean_number, and a 1% chance for 8.333*mean_number. The probability for a city larger than 10x mean_number is actually 0,66%, i.e. you need on average more than 150 cities until one is larger than 10x mean_number.
Since those are random numbers, you milage may vary ...
I'm still not clear on how the patch differs in practice from the current Simutrans implementation...
A short glance at the algorithm would indicate, that you would always have a guranteed Zipf distribution on your map (with some small jittering) compared to the current, more random one (especially for small number of towns). As this is noticeable in practice: just patch and see.
Yes. See attached OpenOffice OpenDocument Spreadsheet
Actually, standard has a better Zipf distribution, the slope is exactly -1 ... The main difference between the patch and the unpatched version is, that the mean number is effectively 2.5 higher than in the patched version (well, more precisely rising from 2 to 2.8, since the slope differs a little.) All in all the effect of this patch can be achieved by dividing the mean_citicen number by 2.4 before starting creation.
Prissi,
thank you very much for the graphs - most useful!
Inkelyad,
did you intend for your patch to have the effect that Prissi describes?
I just plotted Inkelyads data; so the credit should go to him ...
There is something wrong here. See attached data(100 rows 50 cities each). Rank 1 cities larger then 10*mean_number are too common in "Standard".
I beliveve main difference is Rank 1 distributions (see images)
No.
It is hard to get proper "city and satellite towns/villages" map in current implementation. Rank 1 sizes are "too random".
The goal was to correct it.
But it seems to me I was too successful. Now randomness is too small.
Hmm - perhaps a happy medium is to be sought...?
Ok. New version. Now number of 'big cities' is player configurable.
Option is not persistent yet. I don't want break option savefile compatibility.
Interesting... can you give some worked examples with map generation with various options?
Map size: 512x512
Median population: 5000
Number of cities: 50
Number of big cities: 1, 5 and 30
Map size: 512x512
Median population: 3000, 8000 and 16000
Number of cities: 50
Number of big cities: 3
Map size: 128x128
Median population: 1600
Number of cities: 30
Number of big cities: 1, 5 and 20
That's very interesting indeed. I do like the customisability of the new system (which adds something to the existing model). I'd be very interested in people's views on whether this is a good idea, as I'm considering incorporating it into Simutrans-Experimental, if it hasn't already been put into Standard.
I like the idea. Taking a look at the graphics, for me it's clear that standard Simutrans tends to create much more small cities than large ones. It has sense if you want to power the possibilities of the map. Small cities means less developed areas and more margin for the player to expand the game (put more effort into making cities grow). On the other side, Zipfs customizable maps may add some pepper to the initial conditions of the sceneario. The variety that zipfs generates is flexible but also balanced enough to make the initial conditions interesting.
Imho, you should include it at STExp and if players like it, I would estimate the inclusion in ST, too.