예제 #1
0
        /// <summary>
        /// Compute update using the Intelligent Driver Model for car-following model and MOBIL lane change criterion
        /// </summary>
        /// <param name="deltaTime">Time since last update</param>
        public void Update(float deltaTime)
        {
            // Update using FSM and adjust the state accordingly for next update
            DrivingState drivingState = DrivingState.Update(deltaTime);

            if (drivingState != null)
            {
                DrivingState.OnExit();
                DrivingState = drivingState;
                DrivingState.OnEnter();
            }
        }
예제 #2
0
 /// <summary>
 /// Actions to perform when a car is being removed from the world
 /// </summary>
 public void Remove()
 {
     DrivingState.OnExit();
 }