Re: [Bug?] Route Calculations
Reply #19 –
Hmm, I'm afraid not... the only possibility is to add an arbitrary amount to the average waiting time in the calculation, but I doubt that that would do much good. I can't see any way around having to have a full list of destination/waiting time pairs if that part of the calculation is to be made more than a rough approximation. Being a rough approximation is not a serious problem in itself - the amount of time that p****engers spend waiting to take their preferred line or convoy need not be particularly exact.
One change that I have made, however, to mitigate the issue that you raised is that p****engers will not automatically board any convoy that will take them to their next transfer until at least one third of their maximum waiting minutes have expired: see this code:
if(!is_preferred)
{
const uint16 preferred_waiting_minutes = connexions[catg_index]->get(next_transfer) != NULL ? connexions[catg_index]->get(next_transfer)->waiting_time : 15;
const uint16 base_max_minutes = ((welt->get_einstellungen()->get_p****enger_max_wait() / tmp.get_besch()->get_speed_bonus()) * 10) / 3; // Minutes are recorded in tenths. One third max for this purpose.
const uint16 max_minutes = preferred_waiting_minutes > base_max_minutes ? preferred_waiting_minutes : base_max_minutes;
const uint16 preferred_travelling_minutes = connexions[catg_index]->get(next_transfer) != NULL ? connexions[catg_index]->get(next_transfer)->journey_time : 15;
const uint16 waiting_minutes = get_waiting_minutes(welt->get_zeit_ms() - tmp.arrival_time);
if(max_minutes > waiting_minutes && ((preferred_waiting_minutes * 1.5F) - waiting_minutes + preferred_travelling_minutes) < accumulated_journey_time)
{
continue;
}
}
This is probably a reasonable compromise for the time being. Thank you for all your input :-)