Skip to content

Commit

Permalink
Print overall score of a team at end of run
Browse files Browse the repository at this point in the history
This was missing for the CLI version.
Also add a sleep time after starting server to avoid connection problems that happened some time.
  • Loading branch information
klausdorer committed Jul 4, 2023
1 parent c8e7d5c commit e18122b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/magma/tools/benchmark/model/bench/BenchmarkMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -361,7 +360,12 @@ public void run()
if (stopped) {
break;
}
// System.out.println("test" + proxy.getAgentProxies().get(0).toStringVerbose());
}
ITeamResult teamResult = getCurrentTeamResult();
String marker = "---------------------------";
System.out.println(marker + "\nOverall average Score: " + teamResult.getScore() + "\n" + marker);

currentTeam++;
if (stopped) {
break;
Expand Down Expand Up @@ -401,6 +405,12 @@ protected boolean performAverageOutRuns(TeamConfiguration currentTeamConfig, Run
" " + config.getTrainerPort() + " " + scriptPath);
}

try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}

boolean success = startTrainer(config, currentTeamConfig, runInfo, roboVizServer);
if (success) {
collectResults(currentRunResult);
Expand All @@ -417,7 +427,7 @@ protected boolean performAverageOutRuns(TeamConfiguration currentTeamConfig, Run
}
}
String marker = "---------------------------";
System.out.println(marker + "\nAverage Score: " + currentRunResult.getScore() + "\n" + marker);
System.out.println(marker + "\nAverage " + avgRuns + " Score: " + currentRunResult.getScore() + "\n" + marker);
return stopped;
}

Expand Down

0 comments on commit e18122b

Please sign in to comment.