From: brett l. <wak...@gm...> - 2006-07-10 22:03:08
|
On 7/10/06, John A. Tamplin <ja...@ja...> wrote: > brett lentz wrote: > > >The distinction I'm making is that, for #1, we don't have to do any of > >the multiple walks across the connectivity graph or route comparison > >that we'd have to do with #2. > > > > > Then how would it come up with the list of legal routes? > You don't need a list. All you need is the logic for determining whether a route is legal or not. i.e. Contiguous track segements, passing through at least one city with the owner's token, not passing through blocked cities, not going red-to-red, etc. Instead of generating the list of all legal routes, you simply apply the single route given by the user to the set of rules used for determining the validity of the route. If valid, we return the value of the route and move onward. > >So, instead of incurring the costs associated with finding the best > >route, we make the assumption that the user will find it for us. All > >we have to do is validate that the user is providing us with a legal > >route. > > > > > Aside from the recent suggestion which I haven't had a chance to > analyze, these algorithms all generate all possible legal routes and > simply choose the maximum valued one. So, the only possible savings > would be not counting the value of the cities, but I don't think that > saves much. > See above. We skip generating a list of all legal routes, and focus on evaluating the correctness of a single route. > >The UI code will need to be generated anyway, because we're going to > >need to show the user the route we're selecting. This is just the > >difference between programmatically selecting hexes and acting on the > >user's selection of hexes. > > > > > So the user would have to click on hexes they want to use? How would > you handle other things like which city circle to use if the next hop in > the route being built could be either, or whether to pick up something > for treasury money or for dividends? It seems the most straightforward > approach would be a listbox of legal routes, sorted by total value. For > games that require a maximal run, it could restrict the list, and games > which have no other side effects and require a maximal run it shouldn't > show the dialog at all. > Yes, the user would click on the hexes they want to use. If we have the data available, we can also allow the user to click specific city circles that his train hits. At the very least, after the user has selected all of the hexes involved in the route, if there's still ambiguity, we can pop up a dialog box and get the information we need to resolve the ambiguity. Picking up cargo can be handled after route legality is verified. It has no bearing on deciding if a route is valid for a particular train. ---Brett. |