infer the name of the AI using the awk script instead of hardcoding it in the Makefile

master
melvin 2013-04-16 10:51:28 +08:00
parent 83f4303672
commit da3ec6b8d3
2 changed files with 43 additions and 14 deletions

View File

@ -536,19 +536,8 @@ ai/benchmark.%:
ai/merge.%:
seq -f "%02.0f" 1 12 | parallel "cat $*{}.log >> exp/A{}.log"
exp/summary.txt:
cat exp/A01.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MCTS-C-1 > $@
cat exp/A02.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MCTS-C-8 >> $@
cat exp/A03.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MCTS-H-1 >> $@
cat exp/A04.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MCTS-H-8 >> $@
#cat exp/A05.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MMAB-H-1 >> $@
cat exp/A06.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MMAB-H-8 >> $@
cat exp/A07.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MMAB-C-1 >> $@
cat exp/A08.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=MMAB-C-8 >> $@
cat exp/A09.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=VEGAS-H-1 >> $@
cat exp/A10.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=VEGAS-H-8 >> $@
cat exp/A11.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=VEGAS-C-1 >> $@
cat exp/A12.log | awk -f exp/extract_games.awk ai1=MMAB-H-1 ai2=VEGAS-C-8 >> $@
exp/summary.txt: $(wildcard exp/A*.log)
awk -f exp/extract_games.awk $^ > $@
exp/gamma.tsv: exp/summary.txt
exp/whr.rb $^ | tac > $@

View File

@ -2,6 +2,46 @@ BEGIN {
FS = "\t"
}
/index=0/ {
name = "UNKNOWN"
if ($0 ~ /MMAB/) {
name = "MMAB"
} else if ($0 ~ /VEGAS/) {
name = "VEGAS"
} else if ($0 ~ /MCTS/) {
name = "MCTS"
}
cheat = "?"
if ($0 ~ /cheat=true/) {
cheat = "C"
} else if ($0 ~ /cheat=false/) {
cheat = "H"
}
ai1 = name "-" cheat
}
/index=1/ {
name = "UNKNOWN"
if ($0 ~ /MMAB/) {
name = "MMAB"
} else if ($0 ~ /VEGAS/) {
name = "VEGAS"
} else if ($0 ~ /MCTS/) {
name = "MCTS"
}
cheat = "?"
if ($0 ~ /cheat=true/) {
cheat = "C"
} else if ($0 ~ /cheat=false/) {
cheat = "H"
}
ai2 = name "-" cheat
}
/Saved Player/ {
getline
getline
@ -11,5 +51,5 @@ BEGIN {
} else {
C = "B"
}
print ai1 " " ai2 " " C
print ai1 "-" $3 " " ai2 "-" $6 " " C
}