public AnalysisResults < SolutionType > run ( ) { // create results object AnalysisResults < SolutionType > results = new AnalysisResults <> ( ) ; // log LOGGER . info ( ANALYSIS_MARKER , "Started analysis of {} problems {} using {} searches {}." , problems . size ( ) , problems . keySet ( ) , searches . size ( ) , searches . keySet ( ) ) ; // analyze each problem problems . forEach ( ( problemID , problem ) -> { LOGGER . info ( ANALYSIS_MARKER , "Analyzing problem {}." , problemID ) ; // apply all searches searches . forEach ( ( searchID , searchFactory ) -> { // execute burn-in runs int nBurnIn = getNumBurnIn ( searchID ) ; for ( int burnIn = 0 ; burnIn < nBurnIn ; burnIn ++ ) { LOGGER . info ( ANALYSIS_MARKER , "Burn-in of search {} applied to problem {} (burn-in run {}/{})." , searchID , problemID , burnIn + 1 , nBurnIn ) ; // create search Search < SolutionType > search = searchFactory . create ( problem ) ; // run search search . start ( ) ; // dispose search search . dispose ( ) ; LOGGER . info ( ANALYSIS_MARKER , "Finished burn-in run {}/{} of search {} for problem {}." , burnIn + 1 , nBurnIn , searchID , problemID ) ; } // perform actual search runs and register results int nRuns = getNumRuns ( searchID ) ; for ( int run = 0 ; run < nRuns ; run ++ ) { LOGGER . info ( ANALYSIS_MARKER , "Applying search {} to problem {} (run {}/{})." , searchID , problemID , run + 1 , nRuns ) ; // create search Search < SolutionType > search = searchFactory . create ( problem ) ; // attach listener AnalysisListener listener = new AnalysisListener ( ) ; search . addSearchListener ( listener ) ; // run search search . start ( ) ; // dispose search search . dispose ( ) ; // register search run in results object results . registerSearchRun ( problemID , searchID , listener . getSearchRunResults ( ) ) ; LOGGER . info ( ANALYSIS_MARKER , "Finished run {}/{} of search {} for problem {}." , run + 1 , nRuns , searchID , problemID ) ; } } ) ; LOGGER . info ( ANALYSIS_MARKER , "Done analyzing problem {}." , problemID ) ; } ) ; // log LOGGER . info ( ANALYSIS_MARKER , "Analysis complete." ) ; return results ; }
Run the analysis . The returned results can be accessed directly or written to a JSON file to be loaded into R for analysis and visualization using the james - analysis R package . The analysis progress is logged at INFO level all log messages being tagged with a marker analysis .