/// <summary> /// 値コピーを作成する /// </summary> /// <param name="eigenvalue">DEigenvalue</param> public DEigenvalue(DEigenvalue eigenvalue) { operation_time = eigenvalue.operation_time; acceleration = new DEAcceleration(eigenvalue.acceleration); velocity = new DVelocity(eigenvalue.velocity); gap = new DEGap(eigenvalue.gap); }
public DEGap gap; //停止時における車間距離関係 /// <summary> /// 実態を持たせる /// </summary> public DEigenvalue() { operation_time = new double(); acceleration = new DEAcceleration(); velocity = new DVelocity(); gap = new DEGap(); }
/// <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); } }
/// <summary> /// 最適速度の再認識処理 /// </summary> /// <param name="ID">車両ID</param> private void _recognition_optimal_velocity(int ID) { double Voptimal_previous = driver[ID].running.v_optimal.current; double Voptimal = driver[ID].running.v_optimal.current = driver[ID].running.v_optimal.instantaneous; DDelta delta = driver[ID].running.delta; delta.velocity = car[ID].running.velocity.current - Voptimal; DVDifference DVD = driver[ID].running.v_difference; double Vd_n = DVD.current; double Nv_ = 2 / Vd_n * Math.Abs(Voptimal_previous - Voptimal) - 1; double fv_ = 1 / (1 + Math.Exp(-Nv_ / 0.1)); DVelocity DV = driver[ID].eigenvalue.velocity; double Vd_optimal = (DV.c_difference - DV.s_difference) / DV.cruise * Voptimal + DV.s_difference; double Vd = (Vd_optimal - Vd_n) * fv_ + Vd_n; if (Vd > Vd_optimal) { DVD.at_firtst_time = DVD.current = Vd_optimal; } else { if (Vd > DV.s_difference) { DVD.at_firtst_time = DVD.current = Vd; } else { DVD.at_firtst_time = DVD.current = DV.s_difference; } } if (Driver_Mode == DriverMode.Human) { driver[ID].running.RR.random_value.Pg = random.NextDouble(); } driver[ID].running.RR.random_value.Pv = 0; if (car[ID].running.gap > driver[ID].running.gap.influenced) { driver[ID].running.RR.effectiveness = false; } }
/// <summary> /// 値のコピーを作成する /// </summary> /// <param name="velocity">DVelocity</param> public DVelocity(DVelocity velocity) { cruise = velocity.cruise; c_difference = velocity.c_difference; s_difference = velocity.s_difference; }