From: alexti <al...@sh...> - 2010-03-21 18:48:15
|
On Sun, 21 Mar 2010 12:22:30 -0600, brett lentz <bre...@gm...> wrote: > Yes, running the calculation in a separate thread is a good idea. This > would also allow use to begin calculations for the next OR during the > Stock Round. Starting calculations asynchronously is likely problematic. Typically the operating company will lay/upgrade tile and it will often affect the optimal route set, so I am not sure what can be calculated before such track lay is done. But perhaps we could do it while the player decides whether to place station or not (at least placing the station is much less common). > I agree, there should be a tunable timeout value just so we don't take > more than 30 seconds or so to return any value. > > Also, one thing that might be neat to have after the initial > implementation is a way to suggest routing "hints". For example, in > 1830, allow the use to select that they want their route to hit New > York, Boston, and Philadelphia. That gives us some concrete > information that would speed up the calculations quite a bit, I'd > expect. I was thinking about using such hints automatically (by selecting high value cities first), but it is difficult to guarantee that the best routes are selected without checking all of them. It seems that all it achieves is to finds the routes that will eventually be declared best sooner. I think there's some potential in this approach, but it requires to be able to determine at some point that no other route set can improve on already found one. That would require some special order of route iteration and some more sophisticated logic wrt bonuses... If we accept user hints as "requirement" (routes that don't hit New York, Boston and Philadelphia won't be considered at all) it may improve performance, but I am not sure if this is desirable approach. Perhaps it all depends on how fast the automatic calculation will really be. Alex. |