view simulate @ 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 d21c31c6b5ef
children ff8d7b4499f5
line wrap: on
line source

#!/bin/sh

killafter () {
	sleep $1;
	/bin/kill -SIGINT $!;
}

mkfifo .simpipe
if [ $# -gt 1 ]; then 
	bin/sim $1 < .simpipe | bin/lifter > .simpipe & killafter $2
else
	bin/sim $1 < .simpipe | bin/lifter > .simpipe
fi
rm .simpipe