public void onRuntimeStats(RBrokerRuntimeStats stats, int maxConcurrency)
        {
            RBrokerStatsHelper.printRBrokerStats(stats, maxConcurrency);

            if (stats.totalTasksRun == SIMULATE_TOTAL_TASK_COUNT)
            {
                Console.WriteLine("Simulation, total time taken " +
                                  (System.Environment.TickCount - simulationStartTime) + " ms.");

                m_rBroker.shutdown();
                Console.WriteLine("rBroker has been shutdown.");
            }
        }
 public void onTaskError(RTask rTask, String error)
 {
     RBrokerStatsHelper.printRTaskResult(rTask, null, error);
 }
        /*
         * RBrokerAsyncListener methods.
         */

        public void onTaskCompleted(RTask rTask, RTaskResult rTaskResult)
        {
            RBrokerStatsHelper.printRTaskResult(rTask, rTaskResult, null);
            Console.WriteLine("onTaskCompleted: " + rTask + ", score " +
                              ((RNumeric)rTaskResult.getGeneratedObjects()[0]).Value);
        }