Commit c1a3ad69 authored by Christopher Alfeld's avatar Christopher Alfeld

Lots of bug fixes and output improvements.

parent d52ac9c6
...@@ -119,10 +119,10 @@ puts " Log in [file dirname $irfile]/assign.log" ...@@ -119,10 +119,10 @@ puts " Log in [file dirname $irfile]/assign.log"
set run 0 set run 0
while {$run < $maxrun} { while {$run < $maxrun} {
set assignfp [open "|$assign -b -t $testbed $tmpfile | tee -a [file dirname $irfile]/assign.log" r] set assignfp [open "|$assign -b -t $testbed $tmpfile | tee -a [file dirname $irfile]/assign.log" r]
set problem 0 set problems 0
set score -1 set score -1
set seed 0 set seed 0
while {$problem == 0 && [gets $assignfp line] >= 0} { while {$problems == 0 && [gets $assignfp line] >= 0} {
if {[regexp {BEST SCORE: ([0-9]+)} $line match score] == 1} { if {[regexp {BEST SCORE: ([0-9]+)} $line match score] == 1} {
continue; continue;
} }
...@@ -133,10 +133,9 @@ while {$run < $maxrun} { ...@@ -133,10 +133,9 @@ while {$run < $maxrun} {
continue continue
} }
} }
if {$problem > 0} { if {$problems > 0} {
incr run incr run
close $assignfp puts "Run $run resulted in $problems violations."
puts "Run $run resulted in $problem violations."
continue continue
} }
# we should now be ready to read the solution # we should now be ready to read the solution
...@@ -157,7 +156,7 @@ while {$run < $maxrun} { ...@@ -157,7 +156,7 @@ while {$run < $maxrun} {
} }
break break
} }
if {$run > $maxrun} { if {$run >= $maxrun} {
puts "Could not find solution (not deleting $tmpfile)!" puts "Could not find solution (not deleting $tmpfile)!"
exit 1 exit 1
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment