Thank you all for your interesting comments. WLindley - as to your figures, Simutrans (both Standard and Experimental) works, not by starting with the desired end-result (the mathematical function to which you referred) and working backwards from there, but starting with basic economics and working forwards. It is, in other words, a bottom-up approach to p****enger flow modelling, rather than a top-down approach.
It works in this way: each building generates p****engers and mail. The amount generated differs depending on the "level" of the building. They are divided between three groups according to a set formula: (1) town destinations; (2) attraction destinations; and (3) industry destinations. In Experimental, p****engers may have more than one potential destination (in Pak128.Britain-Ex, the maximum number of alternative destinations is 3, meaning that p****engers may have between 1 and 4 potential destinations).
For attraction and industry destinations, p****engers pick their destinations from a weighted list (i.e., a list in which each item can have one or more entry depending on its own "level", and an entry is chosen at random, thus producing a weighted random outcome) of that type of destination. For industries, the list is based only on local factories. One can see which industries are served by which towns by clicking on the industry in question: it will show a list of where its workers come from.
For towns, p****engers (in Experimental) have three different distance settings: short, medium and long-range. Each setting comprises a range of different distances measured in tiles, which can be set in simuconf.tab. There is a weighted preference in favour of local p****engers over midrange p****engers, and midrange p****engers over long-distance p****engers, which can be set in simuconf.tab. In the current Pak128.Britain-Ex, the distances are:
local_p****engers_min_distance = 0
local_p****engers_max_distance = 25
midrange_p****engers_min_distance = 4
midrange_p****engers_max_distance = 100
longdistance_p****engers_min_distance = 50
longdistance_p****engers_max_distance = 16384
(These distances are in kilometres, and are converted into tiles when the data are loaded from simuconf.tab). The weightings in Pak128.Britain-Ex are:
p****enger_routing_local_chance = 43
p****enger_routing_midrange_chance = 37
# p****enger_routing_longdistance_chance is 100 minus the sum of the two above values,
# but not stipulated individually.
The p****engers also have a journey time tolerance, which is randomly set for each p****enger based on a range specified for their distance type:
min_local_tolerance = 20
max_local_tolerance = 60
min_midrange_tolerance = 45
max_midrange_tolerance = 180
min_longdistance_tolerance = 120
max_longdistance_tolerance = 720
A destination town is found from the weighted random list. If that is within the acceptable range of distances for that type of p****enger, the process moves onto the next stage. If not, another entry in the weighted list is sought. The process continues either until a town within range is found, or the maximum number of iterations expires (to prevent deadlocks in cases where there are no towns with range at all). A certain proportion of "local" p****engers will skip the town finding stage all together, and will automatically be set to travel to a destination in their origin town. The proportion depends on the size of their origin town as a fraction of the median starting town size.
Next, the p****engers seek a specific destination within their chosen destination town. Again, a weighted list is used - this time, a weighted list of buildings, weighted by their "level". For p****engers with multiple destinations, the process is repeated until the total set of destinations has been filled. Now, the p****engers try to find a route to their first destination.
Firstly, they check to see whether they are in walking distance of their destination. If they are, they walk, and do not take the player's transport. They then look to see whether there are any transport stops within walking distance (i.e., within the station catchment area specified in simuconf.tab - for Pak128.Britain-Ex, I use 3 tiles, rather than the default 2 for Pak128, partly to compensate for the increase of the scale). In Standard, they latch onto one at (sort of) random; in Experimental, they build a list of all possible origin stops. From each stop, they check all the possible routes to their destination. In Experimental, the routes are stored in the stops along with the journey times. If no route can be found where the journey time is equal to or less than their tolerance (and the p****engers do not have a private car), then they repeat the process with their next destination. If they do not have a next destination, they are marked as "no route" (if there is no route at all) or "too slow" (if the route with the shortest journey time exceeds their tolerance) and do not travel. If, however, they have a private car, they use that instead, and a private car trip is generated, adding to congestion, as well as generating a little private car object in the origin town, which will drive around the roads, getting in the way of 'buses.
The p****engers will, if there is more than one route to their destination, find the route with the least journey time, and use that. They will use whichever origin stop that they can reach that gives them the shortest overall journey time. Where there is a route and p****engers have access to a private car, there is a further calculation (based on a number of factors, including the journey time and the congestion of the origin and destination towns, as well as a car preference factor set in simuconf.tab) to determine whether p****engers use their car or the player's transport.
Whether or not this produces the results to which WLindnely referred I do not know, as I have not conducted those tests. That system, which is adapted from that used in Standard, is driven by a mix of aiming for realism and keeping system performance within acceptable bounds.
Turning to AEO's post, as mentioned above, I try to use a combination of the two factors: the station coverage ratio in Pak128.Britain-Ex is set to 3 tiles rather than 2 (anything greater tends to diminish the possibilities for interesting intra-urban transport), and station and way maintenance costs are scaled with the scale factor, such that, with a distance per tile of 250m, the station and way maintenance costs are 1/4 of such costs at 1km/tile.
The town sizes also need increasing if the scale is increased (with a corresponding reduction in p****enger levels). One contributor to this problem is that the current Pak128.Britain releases lack higher density urban buildings, especially in certain eras. There is currently a concerted effort (see here) to add more urban buildings, which should alleviate this issue substantially in subsequent releases. In the next release of Pak128.Britain-Ex, I am planning substantially to increase the default median town size for this reason.