static void Main(string[] args) { string cmd = ((args.Length >= 1) ? args[0] : ""); if (cmd == "test_blacklist") { Input i = new Input(start_board, num_boards); i.read_scan_black_list(); foreach (int blacked in i.blacklist) { Console.WriteLine(blacked); } } else if (cmd == "test_lookup_scan_cmd_line_by_id") { Input input = new Input(start_board, num_boards); input.read_scans_file(); int id = Convert.ToInt32(args[1]); InputScan scan = input.scans.Find(e => e.id == id); Console.WriteLine(scan.cmd_line); } else if (cmd == "test_lookup_iters") { Input input = new Input(start_board, num_boards); input.read_data(); int scan_id = Convert.ToInt32(args[1]); int board_idx = Convert.ToInt32(args[2]); int scan_idx = 0; foreach (InputScan scan in input.scans) { if (scan.id == scan_id) { break; } scan_idx++; } Console.WriteLine(input.scans_data[scan_idx, (board_idx - input.start_board)]); } else if (cmd == "test_process_sample_run") { Input input = new Input(start_board, num_boards); input.read_data(); Process p = new Process(input); p.SampleRun(); } else if (cmd == "test_process_sample_run_with_constant_quotas") { Input input = new Input(start_board, num_boards); input.read_data(); int quota_value = Convert.ToInt32(args[1]); Process p = new Process(input); p.SampleRunWithConstantQuotas(quota_value); } else if (cmd == "find_optimal_quotas") { Input input = new Input(start_board, num_boards); input.read_data(); int iters_num = Convert.ToInt32(args[1]); Process p = new Process(input); p.FindOptimalQuotas(iters_num); } // List<double> myList = new List<double>(); else { Console.WriteLine("Hello World!"); } }
static void Main(string[] args) { string cmd = ((args.Length >= 1) ? args[0] : ""); if (cmd == "test_blacklist") { Input i = new Input(start_board, num_boards); i.read_scan_black_list(); foreach (int blacked in i.blacklist) { Console.WriteLine(blacked); } } else if (cmd == "test_lookup_scan_cmd_line_by_id") { Input input = new Input(start_board, num_boards); input.read_scans_file(); int id = Convert.ToInt32(args[1]); InputScan scan = input.scans.Find(e => e.id == id); Console.WriteLine(scan.cmd_line); } else if (cmd == "test_lookup_iters") { Input input = new Input(start_board, num_boards); input.read_data(); int scan_id = Convert.ToInt32(args[1]); int board_idx = Convert.ToInt32(args[2]); int scan_idx = 0; foreach (InputScan scan in input.scans) { if (scan.id == scan_id) { break; } scan_idx++; } Console.WriteLine(input.scans_data[scan_idx , (board_idx-input.start_board)]); } else if (cmd == "test_process_sample_run") { Input input = new Input(start_board, num_boards); input.read_data(); Process p = new Process(input); p.SampleRun(); } else if (cmd == "test_process_sample_run_with_constant_quotas") { Input input = new Input(start_board, num_boards); input.read_data(); int quota_value = Convert.ToInt32(args[1]); Process p = new Process(input); p.SampleRunWithConstantQuotas(quota_value); } else if (cmd == "find_optimal_quotas") { Input input = new Input(start_board, num_boards); input.read_data(); int iters_num = Convert.ToInt32(args[1]); Process p = new Process(input); p.FindOptimalQuotas(iters_num); } // List<double> myList = new List<double>(); else { Console.WriteLine("Hello World!"); } }