Mercurial > repos > icfp2012
comparison src/lifter.tp @ 45:9f1ca5ba2684
Discard entries for which we can easily tell that it will be impossible for them to be better than the current best. This allows us to terminate when we cannot solve the map
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 15 Jul 2012 17:26:25 -0700 |
parents | 0c09730c173e |
children | fbeedb3aa239 |
comparison
equal
deleted
inserted
replaced
44:0c09730c173e | 45:9f1ca5ba2684 |
---|---|
70 if: (curfield ended) { | 70 if: (curfield ended) { |
71 if: (curfield score) > (curbest score) { | 71 if: (curfield score) > (curbest score) { |
72 curbest <- curfield | 72 curbest <- curfield |
73 } | 73 } |
74 } else: { | 74 } else: { |
75 nextstates append: curfield | 75 //check theoretical max score for current map state |
76 //discard paths that can never be better than our current best | |
77 if: (curfield maxScore) > (curbest score) { | |
78 nextstates append: curfield | |
79 } | |
76 } | 80 } |
77 } | 81 } |
78 } | 82 } |
79 states <- nextstates | 83 states <- nextstates |
80 n <- n + 1 | 84 n <- n + 1 |