CoolFace
Apppublic

PunitRaveendran/Air_Traffic_Control_System

sourceHugging Faceapache-2.0updated 6mo agoView on Hugging Face
1likes
App README

ATC Agent Hackathon Submission

This Space runs the inference script for the ATC environment. Production-ready OpenEnv-compliant environment for AI agents to act as ATC sequencing controller.

Overview & Motivation

ATC OpenEnv is an Air Traffic Control sequencing environment simulator explicitly designed for AI agents. The primary motivation is to evaluate reinforcement learning and LLM-based agents in an operational safety-critical setting where delays cause compounding penalties and physical errors (like fuel starvation) lead to episode-terminating crashes.

An AI agent acts as the primary ATC sequencing controller, observing inbound flights and making continuous decisions on runway assignments, landing order, and flow expediting. This is a physics-grounded workflow simulation, capturing real ATC operational pressure.

Observation Space

FieldTypeDescription
aircraftList[dict]All aircraft in the sector
aircraft[].idstrUnique aircraft identifier
aircraft[].aircraft_typestrHEAVY, MEDIUM, or LIGHT
aircraft[].prioritystrNORMAL, FUEL_CRITICAL, or EMERGENCY
aircraft[].statusstrINBOUND, HOLDING, ASSIGNED, LANDING, LANDED
aircraft[].distance_nmfloatDistance to runway in nautical miles
aircraft[].speed_knotsfloatCurrent speed in knots
aircraft[].fuelremainingminfloatFuel remaining in minutes
aircraft[].assigned_runwaystrAssigned runway ID (if any)
aircraft[].sequence_positionintPosition in landing sequence
runwaysList[dict]All runways at the airport
runways[].idstrRunway identifier
runways[].statusstrOPEN, REDUCED, or CLOSED
runways[].nextavailablestepintStep when runway is next available
runways[].current_occupantstrAircraft ID currently on runway
timestepintCurrent simulation step
newarrivalscountintNumber of new arrivals this episode
episode_doneboolWhether episode has ended

Action Space

FieldTypeDescription
aircraft_idstrTarget aircraft identifier
action_typestrassign, hold, or expedite
runway_idstrRunway to assign (for assign action)
sequence_positionintLanding sequence position

Tasks

Task 1: Clear Skies

  • —Difficulty: Easy
  • —Aircraft: 5
  • —Runways: 2 (both OPEN)
  • —Fuel: All > 40 min
  • —Emergencies: None
  • —Max Steps: 20
  • —Initial Distances: 10-50 nm spread

Task 2: Fuel Pressure

  • —Difficulty: Medium
  • —Aircraft: 10 initial, 2 arrive at step 5
  • —Runways: 1 OPEN, 1 REDUCED
  • —Fuel Critical: 2 aircraft with < 12 min
  • —Max Steps: 30

Task 3: Full Emergency

  • —Difficulty: Hard
  • —Aircraft: 15 initial, 2 every 4 steps
  • —Runways: 2 (one closes at step 3)
  • —Emergency: One aircraft at step 5
  • —Max Steps: 40

Scoring

Grader 1 (Task 1)

  • —Formula: landingscompleted / totalaircraft - avgdelaypenalty
  • —Focus: Basic landing completion efficiency

Grader 2 (Task 2)

  • —Formula: 40% delay score + 40% fuel-critical handling + 20% separation compliance
  • —Focus: Handling fuel-critical situations

Grader 3 (Task 3)

  • —Formula: 25% landings + 25% emergency + 25% no fuel exhaust + 25% queue < 12
  • —Focus: Multi-objective complex scenario handling

Setup Instructions

Local Setup

Local LLM Inference

To run the inference script locally, you must supply environment variables pointing to your Language Model:

bash
cd atc-openenv
pip install -r requirements.txt

# Linux/macOS
export API_BASE_URL="https://api.openai.com/v1" # Or Hugging Face Router, local vLLM etc.
export MODEL_NAME="gpt-4o"
export HF_TOKEN="your_hugging_face_or_api_key"

# Windows (Command Prompt)
set API_BASE_URL=https://router.huggingface.co/v1
set MODEL_NAME=Qwen/Qwen2.5-72B-Instruct
set HF_TOKEN=hf_YourTokenHere

# Run validation inference
python inference.py

Local API Server

bash
# Run the FastAPI Web API server locally
python -m server.app

Docker Setup

bash
cd atc-openenv
docker build -t atc-openenv .
docker run -p 7860:7860 atc-openenv

API Endpoints

EndpointMethodDescription
/healthGETHealth check
/reset?task_id={1,2,3}POSTReset environment
/stepPOSTExecute actions
/stateGETGet full state

Baseline Scores (from inference.py)

TaskScoreTotal Reward
1 - Clear Skies1.0004.35
2 - Fuel Pressure1.0005.35
3 - Full Emergency0.967-2.00

Example Interaction

python
from env.atc_env import ATCEnv, Action

# Initialize environment
env = ATCEnv()
obs = env.reset(task_id=1)

# Observe current state
print(f"Timestep: {obs.timestep}")
print(f"Aircraft: {len(obs.aircraft)}")
print(f"Runways: {len(obs.runways)}")

# Submit actions (assign aircraft to runways)
actions = [
    Action(aircraft_id="AC1", action_type="assign", runway_id="RW01", sequence_position=1),
    Action(aircraft_id="AC2", action_type="assign", runway_id="RW02", sequence_position=1),
]

# Step simulation
obs, reward, done, info = env.step(actions)
print(f"Reward: {reward.value}")
print(f"Done: {done}")

# Get final state
state = env.state()
print(f"Score so far: {state.score_so_far}")

Wake Turbulence Separation Rules

Lead TypeTrail TypeSeparation (nm)
HEAVYHEAVY4
HEAVYMEDIUM5
HEAVYLIGHT6
MEDIUMLIGHT3
OTHEROTHER2

Reward Events

EventValue
LANDING_SUCCESS+1.0
DELAYPERSTEP-0.05 per waiting aircraft
FUELCRITICALLATE-2.0 per step after threshold
FUEL_EXHAUSTED-10.0
EMERGENCYNOTPRIORITIZED-10.0
SEPARATION_VIOLATION-5.0
RUNWAY_CONFLICT-20.0
HOLDING_PENALTY-0.1 per step per holding aircraft

Environment Implementation

All models use Pydantic v2 for data validation. The environment is fully deterministic given a random seed. Graders are stateless and accept episode_log as input.