#!/opt/local/bin/gawk -f BEGIN { line = 0 FS="." sum=0 ticksPerRandomFree = 10 ticksPerManualFree = 150 } { line = line + 1 if (line == 8) { robots = $5 command = $2 "." $3 " : run_" $4 ".sh --robots " robots FS=" " } if (line == 12) { command = command " --stepsPerCandidate " $4 ticksPerEval = $4 + ticksPerRandomFree + ticksPerManualFree } if (line == 13) { command = command " --initialMutationStepSize " $5 } if (line == 14) { command = command " --reEvaluationRate " $3 } if (line == 15) { command = command " --crossoverRate " $3 } if (line == 16) { command = command " --mutationRate " $3 } if (line == 17) { command = command " --seed " $3 } if (line >= 25) { if ($1 != "WARNING:") { if ($1 != "ParentA:") { print $0 > "tmp_output" } } } } END { steps = int((5000 * robots) / ticksPerEval) e = "./compute_fitness.sh --steps " steps " --logfile tmp_output" system(e) "cat tmp_output_summary" | getline fitness print fitness " : " command }