Mercurial > repos > icfp2012
annotate 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 |
rev | line source |
---|---|
2
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #!/bin/sh |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 killafter () { |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 sleep $1; |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 /bin/kill -SIGINT $!; |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 } |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 mkfifo .simpipe |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 if [ $# -gt 1 ]; then |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 bin/sim $1 < .simpipe | bin/lifter > .simpipe & killafter $2 |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 else |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 bin/sim $1 < .simpipe | bin/lifter > .simpipe |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 fi |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 rm .simpipe |
d21c31c6b5ef
Add dummy files for bin and build. Add simulate script for hooking up simulator and bot.
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |