hdbeukel / james-core

Core module of the JAMES framework
Apache License 2.0
6 stars 5 forks source link

Neighbourhoods: move iterator instead of full list #21

Open hdbeukel opened 9 years ago

hdbeukel commented 9 years ago

Currently, a neighbourhood has two methods: getRandomMove and getAllMoves. The latter yields an unneeded overhead if not all moves are actually inspected. For example, a first descent algorithm (see #19) scans the moves sequentially and accepts the first encountered valid improvement. Instead of constructing a list of all moves, it is thus better to return an iterator from which any subseries of all moves may be generated by the search.

Update interface and all subset neighbourhoods.

hdbeukel commented 9 years ago

Update getBestMove in NeighbourhoodSearch accordingly. Optimize filtering. Remove parameter requireImprovement. Where applicable, it can be checked whether the best move is actually an improvement after it has been obtained.