Exemple #1
0
 /// <summary>
 /// 値のコピーを作成する
 /// </summary>
 /// <param name="running">DRunning</param>
 public DRunning(DRunning running)
 {
     acceleration = new DAcceleration(running.acceleration);
     v_optimal    = new DIC(running.v_optimal);
     v_difference = new DVDifference(running.v_difference);
     gap          = new DGap(running.gap);
     delta        = new DDelta(running.delta);
     RR           = new Recognition_Rate(running.RR);
     pedal        = new Pedal(running.pedal);
 }
Exemple #2
0
        public Pedal pedal;                 //ペダルの踏みかえ関係

        /// <summary>
        /// 実態を持たせる
        /// </summary>
        public DRunning()
        {
            acceleration = new DAcceleration();
            v_optimal    = new DIC();
            v_difference = new DVDifference();
            gap          = new DGap();
            delta        = new DDelta();
            RR           = new Recognition_Rate();
            pedal        = new Pedal();
        }
Exemple #3
0
        /// <summary>
        /// 最適速度へ加速度の再調節処理
        /// </summary>
        /// <param name="ID">車両ID</param>
        private void _redecide_acceleration(int ID)
        {
            DVDifference DVD = driver[ID].running.v_difference;
            double       Voptimal = driver[ID].running.v_optimal.current;
            double       V = car[ID].running.velocity.current;
            double       Nv_n = 2 / DVD.current * (Voptimal - V) - 1;
            double       fv_n = 1 / (1 + Math.Exp(-Nv_n / 0.1));
            double       fg = driver[ID].running.RR.fg.value;
            double       a_max = __calculate_maximum_acceleration(ID) * DVD.current / DVD.at_firtst_time;
            double       deltaG = driver[ID].running.delta.gap;
            double       minimum_a = car[ID].eigenvalue.acceleration.minimum;
            double       f, next_a;

            if (deltaG <= 0)
            {
                f = (1 - fv_n) * fg + fv_n;
            }
            else
            {
                f = (fv_n - 1) * fg + 1;
            }
            next_a = a_max * f;
            if (Math.Abs(next_a) < minimum_a)
            {
                if (a_max > 0)
                {
                    next_a = minimum_a;
                }
                else
                {
                    next_a = -minimum_a;
                }
            }
            driver[ID].running.acceleration.value = next_a;
            __pedal_changing(ID);
            if (Driver_Mode == DriverMode.Human)
            {
                driver[ID].running.RR.random_value.Pv = random.NextDouble();
            }
            double ABS = Math.Abs(Voptimal - V);

            if (ABS < driver[ID].running.v_difference.current)
            {
                if (ABS > driver[ID].eigenvalue.velocity.s_difference)
                {
                    DVD.current = ABS;
                }
                else
                {
                    DVD.current = driver[ID].eigenvalue.velocity.s_difference;
                }
            }
        }
Exemple #4
0
        /// <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;
            }
        }
Exemple #5
0
 /// <summary>
 /// 値のコピーを作成する
 /// </summary>
 /// <param name="difference">DVDifference</param>
 public DVDifference(DVDifference difference)
 {
     at_firtst_time = difference.at_firtst_time;
     current        = difference.current;
 }