Rails-18xx / Rails

Rails 18xx Java Application Main Repository
GNU General Public License v2.0
36 stars 22 forks source link

1826: token cost calculation now finally works in complex networks #523

Closed erik-vos closed 1 year ago

erik-vos commented 1 year ago

My initial approach to finding distances of tokenable cities from nearest tokens was using the graph iterator from SimpleGraph. That turned out to be too hard for me. In a second try, I made my own graph with doubly linked lists (class DLLGraph), still using that iterator, and use that DLL graph to travel through the network. Initially that looked promising, but in complex networks with branching track it ultimately failed too. A few days ago I got the brainwave to skip all those graphs, and travel through the network by directly following tile tracks. That turned out to be amazingly simple.

A very fruitful idea was to start using real games for testing. I used three 1826 games published in Steve Thomas' 'zine. These games are now part of the regression test set.