コード例 #1
0
 /// <summary>
 /// ドライバーの特徴を初期化
 /// </summary>
 private void _initialize_driver_eigenvalue()
 {
     driver = new List <Driver_Structure>(N);
     for (int i = 0; i < N; i++)
     {
         Change_Unit change = new Change_Unit();
         DVelocity   DV     = new DVelocity();
         DV.cruise       = change.km_h__to__m_s(100);
         DV.c_difference = change.km_h__to__m_s(15);
         DV.s_difference = change.km_h__to__m_s(1);
         Pedal pedal = new Pedal();
         pedal.foot_position = FootPosition.accel_pedal;
         pedal.time_elapsed  = pedal.time_required = 0;
         DGap dg = new DGap();
         dg.closest = dg.cruise = dg.influenced = 0;
         DEGap  deg = new DEGap();
         double operation_time;
         if (Driver_Mode == DriverMode.Human)
         {
             operation_time = 0.75;
             deg.stop       = 3;
             deg.move       = 6;
         }
         else
         {
             operation_time = 0.05;
             deg.stop       = 1;
             deg.move       = 1.1;
         }
         Driver_Structure DS = new Driver_Structure();
         DS.eigenvalue.acceleration.acceleration = change.km_h__to__m_s(60) / 10;
         DS.eigenvalue.acceleration.deceleration = Math.Pow(change.km_h__to__m_s(100), 2) / 2 / 60;
         DS.eigenvalue.operation_time            = operation_time;
         DS.eigenvalue.velocity      = new DVelocity(DV);
         DS.eigenvalue.gap           = new DEGap(deg);
         DS.running.pedal            = new Pedal(pedal);
         DS.running.gap              = new DGap(dg);
         DS.running.v_optimal        = new DIC(0, 0);
         DS.running.RR.random_value  = new Random_Value(0, 0);
         DS.running.RR.effectiveness = true;
         DS.running.v_difference     = new DVDifference(deg.stop, deg.stop);
         driver.Add(DS);
     }
 }
コード例 #2
0
 /// <summary>
 /// 値のコピーを作成する
 /// </summary>
 /// <param name="driver">Driver_Structure</param>
 public Driver_Structure(Driver_Structure driver)
 {
     running    = new DRunning(driver.running);
     eigenvalue = new DEigenvalue(driver.eigenvalue);
 }