Add batch eval and card-skip A/B scripts
eval_batch.sh: N back-to-back sessions with per-session summaries. ab_card_skip.sh: A/B the jev vs combined card-reward skip policy and compare deck size and progress from the game's run history.
This commit is contained in:
parent
41e3ea4a2b
commit
efd7d2e423
2 changed files with 101 additions and 0 deletions
25
eval_batch.sh
Executable file
25
eval_batch.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
# Run N sessions back to back and collect the resulting run records.
|
||||
# The bot handles menu/character-select navigation itself, so no setup is needed.
|
||||
set -u
|
||||
|
||||
# Fail fast if the bot cannot start a run (e.g. a pending Timeline epoch).
|
||||
if ! python3 run.py --steps 1 >/tmp/preflight.log 2>&1; then
|
||||
cat /tmp/preflight.log
|
||||
exit 2
|
||||
fi
|
||||
SESSIONS="${1:-4}"
|
||||
STEPS="${2:-600}"
|
||||
for i in $(seq 1 "$SESSIONS"); do
|
||||
echo "=== session $i/$SESSIONS ==="
|
||||
python3 run.py --steps "$STEPS" --pause 0.3 > "/tmp/eval_${i}.log" 2>&1
|
||||
echo " exit=$? takes=$(grep -c 'select_card_reward' "/tmp/eval_${i}.log") skips=$(grep -c 'skip_card_reward' "/tmp/eval_${i}.log")"
|
||||
python3 - <<'PY'
|
||||
import sts2
|
||||
try:
|
||||
d = sts2.state(); p = d.get('player') or {}
|
||||
print(f" now: {d.get('state_type')} run={d.get('run')} hp={p.get('hp')}/{p.get('max_hp')}")
|
||||
except Exception as e:
|
||||
print(f" state read failed: {e}")
|
||||
PY
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue