Beispiel #1
0
 public void clientEvent(Set<SocketClient> clients, String message) {
   int nbCores = 0;
   int nbThreads = 0;
   for (SocketClient client : clients) {
     nbCores += client.clientInfo().nbCores;
     nbThreads += client.clientInfo().nbThreads;
   }
   clientsLog.writeRow(chrono.getCurrentMillis(), clients.size(), nbThreads, nbCores);
   Messages.println(
       String.format(
           "%s %d[%d] client%s",
           message, clients.size(), nbThreads, clients.size() > 1 ? "s" : ""));
 }
Beispiel #2
0
 @Override
 public void run() {
   Runner runner = context.createRunner(counter, parameters);
   AgentEvaluator behaviourRewardMonitor =
       context.connectBehaviourRewardMonitor(runner, parameters);
   AgentEvaluator targetRewardMonitor =
       context.connectTargetRewardMonitor(counter, runner, parameters);
   Chrono chrono = new Chrono();
   boolean diverged = false;
   try {
     runner.run();
   } catch (Throwable e) {
     behaviourRewardMonitor.worstResultUntilEnd();
     targetRewardMonitor.worstResultUntilEnd();
     diverged = true;
   }
   computationTime = chrono.getCurrentMillis();
   behaviourRewardMonitor.putResult(parameters);
   targetRewardMonitor.putResult(parameters);
   parameters.putResult("computationTime", diverged ? -1 : computationTime);
   parameters.putResult("totalTimeStep", runner.runnerEvent().nbTotalTimeSteps);
 }
Beispiel #3
0
 public void jobEvent(Runnable done) {
   if (!(done instanceof TimedJob)) return;
   cumulatedTime += ((TimedJob) done).getComputationTimeMillis();
   double ratio = cumulatedTime / (double) chrono.getCurrentMillis();
   jobsLog.writeRow(chrono.getCurrentMillis(), cumulatedTime, ratio);
 }