Ejemplo n.º 1
0
 public CG(read_file r)
 {
     column_pool = new List <int[, ]> [r.total_train_num];
     cost_pool   = new List <int> [r.total_train_num];
     path_pool   = new List <int[]> [r.total_train_num];
     for (int i = 0; i < column_pool.Length; i++)
     {
         column_pool[i] = new List <int[, ]>();
         cost_pool[i]   = new List <int>();
         path_pool[i]   = new List <int[]>();
     }
     this.r       = r;
     resource_num = (r.station_num - 2) * 2 + 2;
     miu          = new double[resource_num, r.time_len];
     sigma        = new double[r.total_train_num];
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string str = AppDomain.CurrentDomain.BaseDirectory;

            str += "input_file";
            read_file r = null;

            try
            {
                r = new read_file(str);
            }
            catch (Exception)
            {
                Console.WriteLine("请关闭输入文件!!!");
            }
            CG c = new CG(r);

            Console.WriteLine("正在计算。。。。。。。。。。。。。。。");
            c.main();
            Console.WriteLine("*****************************************");
            Console.WriteLine("计算完毕,请打开NEXTA.exe查看");
            Console.ReadLine();
        }
Ejemplo n.º 3
0
 public train(read_file r, int train_id)
 {
     tf            = int.Parse((string)r.blocking_time.Rows[train_id - 1][1]);
     tp            = int.Parse((string)r.blocking_time.Rows[train_id - 1][2]);
     this.r        = r;
     total_num     = ((r.station_num - 2) * 3 + 2) * r.time_len + 2;// with start point and end point
     this.train_id = train_id;
     station_range = new List <int>();
     if (r.dir[train_id - 1] == 1)
     {
         for (int i = 1; i <= r.station_num; i++)
         {
             station_range.Add(i);
         }
     }
     else
     {
         for (int i = r.station_num; i >= r.station_num; i--)
         {
             station_range.Add(i);
         }
     }
 }