src/AircraftTrajectories/Models/Optimisation/FlightSimulator.cs
/// <summary>
/// Switch to a different vertical state if needed
/// </summary>
Switch to a different vertical state if needed
Switch to a different vertical state if needed
protected void updateVerticalState()
        {
            switch (_vertical_state)
            {
                case VERTICAL_STATE.TAKEOFF:
                    if (_height >= 1500) {
                        _vertical_state = VERTICAL_STATE.CLIMB;
                    }
                    break;
                case VERTICAL_STATE.CLIMB:
                    if (_height >= 3600 || _speed >= 250) {
                        _vertical_state = VERTICAL_STATE.FREECLIMB;
                    }
                    break;
                default:
                    break;
            }
        }
protected void updateVerticalState ( ) { switch ( _vertical_state ) { case VERTICAL_STATE . TAKEOFF : if ( _height >= 1500 ) { _vertical_state = VERTICAL_STATE . CLIMB ; } break ; case VERTICAL_STATE . CLIMB : if ( _height >= 3600 || _speed >= 250 ) { _vertical_state = VERTICAL_STATE . FREECLIMB ; } break ; default : break ; } }
Switch to a different vertical state if needed
Switch to a different vertical state if needed
/*
                    if (_height >= 6000 || _speed >= _aircraft.VClean) {
                        Console.WriteLine("Trajectory reached max height or VClean");
                        _vertical_state = VERTICAL_STATE.END;
                    }
                    */ /*
                    // force stop:
                    if (duration >= 750) {
                        Console.WriteLine("Trajectory timeout");
                        fuel = int.MaxValue;
                        _vertical_state = VERTICAL_STATE.END;
                    }
                    */