Mercurial > repos > icfp2012
diff src/lifter.tp @ 67:ff8d7b4499f5 default tip
Submission prep
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 16 Jul 2012 04:48:50 -0700 |
parents | ff2b38518a58 |
children |
line wrap: on
line diff
--- a/src/lifter.tp Mon Jul 16 04:37:00 2012 -0700 +++ b/src/lifter.tp Mon Jul 16 04:48:50 2012 -0700 @@ -138,11 +138,9 @@ } } cullStatesTo <- :n { - os write: 2 "culling " . (states length) . " to " . n . "\n" if: n < (states length) { states <- topN: states n } - os write: 2 "states length is now " . (states length) . "\n" } } } @@ -186,48 +184,17 @@ text <- sim readFd: 0 initial <- (sim state) fromStr: text - os write: 2 text - os write: 2 "width: " . (string: (initial width)) . "\n" - os write: 2 "height: " . (string: (initial height)) . "\n" finder <- moveFinder: initial maxsteps <- initmaxsteps while: { bestMove: finder withMaxSteps: maxsteps } do: { - //best <- -1000000 - //bestscore <- -1000000 - //foreach: (finder states) :idx el { - // h <- (el heuristic) - // s <- (el score) - // if: (h > best) { - // best <- h - // } - // if: (s > bestscore) { - // bestscore <- s - // } - //} if: ((finder states) length) > cullwhenover { finder cullStatesTo: cullstates } maxsteps <- aftermaxsteps - os write: 2 "--------iteration results-------\n" - os write: 2 "Best:\n" - (finder curbest) printGrid - //os write: 2 "Hash: " . ((finder curbest) hash) - //os write: 2 "Current before cull\n" - //os write: 2 " Best Heuristic: " . best . "\n" - //os write: 2 " Best Score: " . bestscore . "\n" - //os write: 2 "After cull:\n" - //foreach: (finder states) :idx el{ - // os write: 2 " " . idx . " Heuristic: " . (el heuristic) . "\n" - // os write: 2 " " . idx . " Score: " . (el score) . "\n" - //} - //os write: 2 "Current:\n" - //(finder playfield) printGrid } - os write: 2 "---------------\n" - os write: 2 "End Best:\n" - (finder curbest) printGrid + (finder curbest) printMoves 0 } }