CheckCell.WorkbookState.RunSimulations C# (CSharp) Method

RunSimulations() private static method

private static RunSimulations ( Microsoft.Office.Interop.Excel app, Microsoft.Office.Interop.Excel wb, Random rng, UserSimulation c, string output_dir, double thresh, ProgBar pb ) : void
app Microsoft.Office.Interop.Excel
wb Microsoft.Office.Interop.Excel
rng System.Random
c UserSimulation
output_dir string
thresh double
pb DataDebugMethods.ProgBar
return void
        private static void RunSimulations(Excel.Application app, Excel.Workbook wb, Random rng, UserSimulation.Classification c, string output_dir, double thresh, ProgBar pb)
        {
            // number of bootstraps
            var NBOOTS = 2700;

            // the full path of this workbook
            var filename = app.ActiveWorkbook.Name;

            // the default output filename
            var r = new System.Text.RegularExpressions.Regex(@"(.+)\.xls|xlsx", System.Text.RegularExpressions.RegexOptions.Compiled);
            var default_output_file = "simulation_results.csv";
            var default_log_file = r.Match(filename).Groups[1].Value + ".iterlog.csv";

            // save file location (will append for additional runs)
            var savefile = System.IO.Path.Combine(output_dir, default_output_file);

            // log file location (new file for each new workbook)
            var logfile = System.IO.Path.Combine(output_dir, default_log_file);

            // disable screen updating
            app.ScreenUpdating = false;

            // run simulations
            UserSimulation.Config.RunSimulationPaperMain(app, wb, NBOOTS, 0.95, thresh, c, rng, savefile, MAX_DURATION_IN_MS, logfile, pb, IGNORE_PARSE_ERRORS);

            // enable screen updating
            app.ScreenUpdating = true;
        }