当前位置: 首页>>代码示例>>C#>>正文


C# Input.read_scans_file方法代码示例

本文整理汇总了C#中Input.read_scans_file方法的典型用法代码示例。如果您正苦于以下问题:C# Input.read_scans_file方法的具体用法?C# Input.read_scans_file怎么用?C# Input.read_scans_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Input的用法示例。


在下文中一共展示了Input.read_scans_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    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!");
        }
    }
开发者ID:BackupTheBerlios,项目名称:fc-solve-svn,代码行数:77,代码来源:find_opt.cs


注:本文中的Input.read_scans_file方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。