[Bug v6.2] Tolerance Values August 06, 2009, 08:08:08 pm James,From what I learnt from your comments in get_average_waiting_time() and add_connexion() of haltestelle_t, waiting time and journey time are calculated and stored in *tenths* of minute, right?If that is the case, the following tolerance values should be multiplied by 10, as your simuconf.tab comment states that they are expressed in minutes :Quotemin_local_tolerance = contents.get_int("min_local_tolerance", min_local_tolerance);max_local_tolerance = contents.get_int("max_local_tolerance", max_local_tolerance) - min_local_tolerance;min_midrange_tolerance = contents.get_int("min_midrange_tolerance", min_midrange_tolerance);max_midrange_tolerance = contents.get_int("max_midrange_tolerance", max_midrange_tolerance) - min_midrange_tolerance;min_longdistance_tolerance = contents.get_int("min_longdistance_tolerance", min_longdistance_tolerance);max_longdistance_tolerance = contents.get_int("max_longdistance_tolerance", max_longdistance_tolerance) - min_longdistance_tolerance;Otherwise, when you compare tolerance level against journey time of the returned path, your comparison will be wrong.Edit :There is actually another problem with the above code. You have subtracted max from min before saving it to the max variables. It is not wrong to precalculate the difference between max and min, but you have to change the names of the internal variables and getter functions to reflect the fact that they are no longer the maximum, but the difference between max and min. Otherwise, it would be misleading to other developers. Remember, the code you write will be read and used by others, and thus please keep your code unconfusing, consistent, readable and easily understandable. Knightly Quote Selected Last Edit: August 07, 2009, 09:40:20 am by Knightly
Re: [Bug v6.2] Tolerance Values Reply #1 – August 07, 2009, 03:04:07 pm Knightly,thank you for this (and your other work). Apologies for not replying sooner on this and other mattesr: I have been busy at work and also, in Simutrans time, with fine-tuning the physics and settings for Pak128.Britain. I thought that I'd reply to this one quickly, though, to let you know that I have both implemented your suggested change (thank you for spotting that bug) and had already spotted the other bug that you identify in your edit, and fixed that, too, which fix will be available in version 6.3. Quote Selected
Re: [Bug v6.2] Tolerance Values Reply #2 – August 08, 2009, 08:00:40 am Thank you very much for the changes! Quote Selected