From: John A. T. <ja...@ja...> - 2006-07-07 21:49:26
|
Erik Vos wrote: >I guess it's mostly a matter of words. >To me, the Track, Junction and Station objects *are* the connectivity graph. >Our difference then is, as it seems to me, that you restrict the cloning >to those Track, Junction and Station objects, not including >the parent tile itself. Not much saving, I would think. > >Or does your graph consist of entirely different objects? > > If you use them as the connectivity graph, then you wind up pointing into Junction objects in other Tile objects, which means the Junction objects have to have a reference the parent Station or Tile object (which complicates a common superclass). Another problem is maintiaining multiple connectivity graphs -- as mentioned in the first message you really want to have different types of connectivity graphs for tile laying, token placement, and route calculations. For the latter, you also need to have different connectivity graphs for each company. What I am proposing is a triangular (since the edges are bi-directional) 2-D bitvector which encodes connectivity between all the things you want to care about. That would be maintained totally outside the data structure for the tiles, which would be immutable once loaded from the database. You could have as many different connectivity graphs as you like without a problem. Even if you don't want to do it with a bitvector, I think you still want to have the connectivity graph outside the tile data structure. -- John A. Tamplin ja...@ja... 770/436-5387 HOME 4116 Manson Ave Smyrna, GA 30082-3723 |