The Problem
During the 2024 Monaco Grand Prix, a single miscalculated pit stop decision cost a leading team a podium finish. The strategy team had 30 seconds to decide with incomplete data and no way to test alternatives. That decision was irreversible and cost millions.
F1 strategy decisions are made under extreme pressure:
- Limited testing: $50,000+ per track session, restricted by regulations
- Incomplete information: Competitor strategies, weather changes, tire degradation uncertainty
- Irreversible consequences: Wrong pit timing = lost positions, lost points, lost championships
- Time pressure: 30-second decision windows during races
Current tools rely on Excel models and experience-based intuition, validated only post-race when it's too late.
Our Solution
Apex Engine is a lightweight, event-driven race simulator that models competitive F1 scenarios and outputs actionable strategy intelligence in real-time.
What Makes It Different
Traditional F1 strategy tools predict outcomes based on static models. Apex Engine simulates competitive dynamics—when you change your strategy, competitors react, creating cascading effects that simple models miss.
Core Capabilities:
- Model 20+ cars executing different strategies simultaneously
- Dynamic event injection (weather changes, safety cars, tire degradation)
- Real-time decision support ("If Mercedes pits now, your optimal response is...")
- Strategy effectiveness analysis across 1,000+ scenario variations
Technical Architecture
System Design Philosophy
We built Apex Engine around three principles:
1. Lightweight = Fast Decisions
Race engineers need answers in seconds, not minutes. Our architecture prioritizes speed over perfect accuracy.
2. Probabilistic Realism
Events aren't random—they're state-dependent. Aggressive driving on worn tires increases incident probability. This creates realistic risk-reward trade-offs.
3. Competitive Interaction
Agents don't just follow scripts—they react to each other. An undercut attempt triggers defensive responses, creating emergent strategic complexity.
Core Components
Event Engine → Agent Decisions → State Management → Analytics Output
↓ ↓ ↓ ↓
Weather Pit Timing Position Tracking Win Probability
Safety Car Tire Choice Collision Detection Strategy Ranking
Tire Wear Fuel Mode Lap Time Simulation Decision Support
Event Engine: Injects dynamic conditions (weather transitions, safety cars, incidents) with probabilities based on historical data and current race state.
Agent Decision Framework: Each car executes a configurable strategy (aggressive one-stop, conservative two-stop, adaptive reactive) with rule-based logic that responds to race conditions.
State Management: Tracks positions, gaps, tire conditions, fuel levels, and lap times with lightweight physics approximations optimized for strategic accuracy over simulation fidelity.
Analytics Layer: Calculates win probabilities, identifies critical decision windows, and ranks strategy effectiveness across scenario variations.
The F1 Use Case: Pit Strategy Optimization
Pre-Race: Strategy Development
Current Approach: Strategy engineers manually analyze 10-15 scenarios using spreadsheets. Takes 4-6 hours per race weekend.
With Apex Engine: Simulate 10,000 strategy variations in 30 minutes.
Example Output:
Strategy Performance Analysis - Circuit de Monaco
One-Stop Aggressive (Soft → Medium, Lap 18 pit):
Win Rate: 42%
Avg Finish: P3.2
Risk: High (35% chance of P6 or worse)
Best If: No safety car, clean air after pit
Two-Stop Conservative (Medium → Medium → Soft, Laps 15 & 35):
Win Rate: 28%
Avg Finish: P2.8
Risk: Low (Consistent P2-P4 range)
Best If: Safety car likely, high degradation
Adaptive Strategy (Pit based on leader's decision):
Win Rate: 51%
Avg Finish: P2.3
Risk: Medium
Best If: Uncertain conditions, need flexibility
Key Insight: The adaptive strategy wins most often because it reacts to competitor decisions. Traditional models miss this because they simulate strategies in isolation.
During Race: Real-Time Decision Support
Scenario: Lap 18, you're P3 on medium tires (12 laps old), 3.2 seconds behind P2.
Strategy engineer asks: "Should we pit now or wait?"
Apex Engine re-simulates in 5 seconds:
Current State Analysis - Lap 18/78
IF P2 pits this lap:
→ STAY OUT 2 more laps (undercut defense)
→ Win probability: 68%
→ Expected finish: P2
IF P2 stays out:
→ PIT NOW (undercut attempt)
→ Win probability: 54%
→ Expected finish: P3
IF safety car deployed (12% probability next 5 laps):
→ PIT IMMEDIATELY (free stop)
→ Win probability: 87%
→ Expected finish: P1
Decision made: Wait and react to P2's decision. If they pit, stay out. If safety car, pit immediately.
Result: Clear decision tree based on 1,000 simulated outcomes, delivered in seconds.
How It Works: The Simulation Loop
1. Race State Initialization
Load race parameters:
- Circuit characteristics (lap time, pit loss, overtaking difficulty)
- Car performance (pace advantage, tire degradation rates)
- Starting strategies for each competitor
- Weather forecast and safety car probability
2. Event-Driven Time Progression
Each simulation tick (representing one lap):
A. Event Generation
Calculate probabilities based on current state:
Incident Risk = Base Risk × Tire Wear Multiplier × Traffic Multiplier × Weather Multiplier
Example:
Base: 0.5% per lap
Worn tires (>75%): 2.5x
Heavy traffic: 1.8x
Wet conditions: 3.0x
→ Total Risk: 0.5% × 2.5 × 1.8 × 3.0 = 6.75% this lap
B. Agent Decision Making
Each car evaluates:
- Should I pit this lap? (based on tire condition, gap to cars ahead/behind, race position)
- What tire compound? (based on remaining laps, weather forecast, strategy target)
- What fuel mode? (based on position, gap management needs)
C. State Update
Calculate lap times based on:
- Tire age penalty (older tires = slower laps)
- Fuel weight reduction (lighter car = faster laps)
- Traffic impact (overtaking difficulty, DRS availability)
- Weather conditions (wet = slower, high variance)
D. Position Recalculation
Update running order, gaps between cars, and check for position changes including pit stop overtakes (undercut/overcut dynamics).
3. Outcome Analysis
After 1,000 simulations, aggregate results:
- Position distribution for each strategy
- Win probability and podium likelihood
- Critical decision points (which laps had highest impact)
- Sensitivity analysis (how robust is the strategy to variations)
Key Innovation: Competitive Strategy Modeling
Why Existing Tools Fall Short
Most strategy software treats competitors as static. They ask: "What happens if we do X?"
Apex Engine asks: "What happens if we do X, competitors see it, and react optimally?"
Example: The Undercut Battle
Scenario: You're P2, 2 seconds behind the leader. Both on same strategy. Who pits first?
Traditional Model:
- If you pit Lap 20: Lose 22 seconds, emerge P4, need to overtake → Predict P3 finish
- If you wait until Lap 25: Maintain position, pit later → Predict P2 finish
- Conclusion: Wait until Lap 25
Apex Engine Competitive Model:
- If you pit Lap 20: Leader sees you pit, has 3 choices:
- Pit immediately (cover) → Both lose time equally → You gain nothing
- Stay out 1 lap (react) → They get 1 lap on fresh tires advantage → You lose position
- Stay out 3+ laps (ignore) → Your fresh tires gain 0.4s/lap → Undercut succeeds, you lead
Simulation outcome: Leader stays out 1 lap (optimal defense) 68% of the time → Your Lap 20 pit succeeds only 32%
Revised conclusion: Wait for leader to pit first, then react. Don't initiate.
This type of game-theoretic analysis is impossible with static models.
Technical Implementation Strategy
Phase 1: Core Simulation
Build:
- Race state representation (positions, tire age, fuel load)
- Basic physics model (lap time calculation based on tire wear)
- Pit stop logic (time loss, tire changes, position impacts)
- Event generator (safety cars, weather changes)
Demo: 20-car race, single weather condition, three strategy types
Phase 2: Intelligence Layer
Build:
- Multi-scenario batch simulation (run 1,000 variations)
- Strategy effectiveness analytics
- Real-time decision support API
- Visualization dashboard (leaderboard, strategy rankings)
Demo: Interactive tool where judges input race conditions and get strategy recommendations in seconds
Phase 3: Validation
Validate:
- Backtest 2024 races (did simulator predict actual outcomes?)
- Sensitivity analysis (small changes = small outcome differences?)
- Expert review (do F1 engineers find recommendations credible?)
Deliverable: Documented accuracy metrics and validation methodology
Why This Wins
1. Perfect Sponsor Alignment
MoneyGram Haas F1 Team is the primary sponsor. We're solving their actual problem. This isn't a generic "mobility" solution adapted to racing—it's purpose-built for F1 strategy optimization.
2. Demonstrates Systems Thinking
Most hackathon projects showcase ML models or API integrations. Apex Engine demonstrates distributed systems design, game theory, and probabilistic modeling—skills that Mphasis and F1 teams actually need.
3. Clear Commercial Value
F1 teams spend millions on proprietary strategy tools. We're building an accessible alternative that smaller teams can use. Single prevented strategy mistake = championship points = millions in prize money.
4. Demo-Friendly
Live leaderboards showing 20 cars racing, strategy shifts, and real-time decision support are visually engaging and immediately understandable, even to non-technical judges.
5. Achievable Scope
Unlike vague "AI platforms," we have a concrete, testable deliverable: Run Singapore 2024 GP through our simulator, show it predicts Norris's strategy success, demonstrate our tool would have recommended the same approach.
Impact Potential
For F1 Teams
Current State:
- Strategy development: 4-6 hours per race weekend
- Scenarios tested: 10-15 manually
- In-race decision time: 30+ seconds
- Validation: Post-race analysis only
With Apex Engine:
- Strategy development: 30 minutes automated
- Scenarios tested: 10,000+ variations
- In-race decision time: 5 seconds
- Validation: Pre-race simulation testing
ROI: Haas F1 Team budget is $150M/year. Better strategy could mean 5-10 additional championship points = $5-10M in prize money. Our tool costs near-zero to operate.
Broader Applications
While we focus on F1 for this competition, the architecture extends to:
- Formula E: Battery management strategy optimization
- Endurance Racing: Multi-driver stint planning, fuel strategy
- Rally: Stage-by-stage tire and pace strategy
Validation Strategy
How We Prove It Works
1. Historical Backtesting
Simulate completed 2024 races with known strategies:
- Target: 70%+ accuracy on race winner prediction
- Success metric: Simulator recommends strategies that actually won
2. Expert Consultation
Interview with F1 strategy engineer or racing analyst:
- "Does pit stop timing align with real dynamics?"
- "Are tire degradation curves realistic?"
- "Would you trust these recommendations?"
3. Sensitivity Analysis
Ensure robust behavior:
- Small input changes (±1 lap pit window) → Small output changes (±1-2 positions)
- No chaotic behavior or unrealistic outcomes
Technical Stack
Simulation Core: TypeScript (rapid development, easy to demo)
Performance-Critical Components: Rust compiled to WebAssembly (physics calculations, spatial indexing)
Visualization: React + HTML5 Canvas (lightweight, no WebGL complexity)
Real-Time Updates: WebSocket for live race simulation streaming
Deployment: Static hosting (Vercel/Netlify) with serverless functions for heavy batch simulations
Why This Stack: Balances development speed, performance, and the "lightweight" requirement. No ML frameworks, no GPU dependencies, runs in browser.
The Competitive Edge
Most teams will choose PS1 (Computer Vision): Crowded space, every ML enthusiast goes there.
PS3 Mobility Simulator is strategic:
- Fewer teams (requires systems architecture maturity)
- Perfect F1 sponsor alignment (MoneyGram Haas)
- Demonstrates engineering depth, not just ML buzzwords
We're not competing against 1,450 participants. We're competing against ~50 teams who chose PS3, and perhaps 10 who understand event-driven systems and competitive modeling.
That's our advantage.
Conclusion
Formula 1 revolutionized car development by moving from track testing to wind tunnels to CFD simulation. Each shift increased experimentation velocity by 10-100x while reducing costs dramatically.
Strategy is the final frontier.
Physical testing is too expensive, too slow, and too risky. Traditional tools use static models that ignore competitive dynamics. Apex Engine brings true competitive simulation to F1 strategy development.
When a team can test 10,000 pit strategies in the time it takes to complete one practice session, when they can react to competitor moves in 5 seconds instead of 30, when they can validate approaches before the race weekend even begins—that's when strategy becomes a competitive advantage instead of educated guesswork.
We're not building another simulator. We're building the infrastructure for fearless strategic experimentation.
Find the fastest line. We'll show you every alternative.
Technology: TypeScript, Rust/WASM, React, WebSocket
Demo: Interactive F1 race simulation with real-time strategy comparison
Timeline: 4-week sprint to validated prototype
Target: MoneyGram Haas F1 Team strategy optimization
Built With
- ergast-f1-api
- github
- javascript
- react
- three.js
- typescript
- websocket
- zustand
Log in or sign up for Devpost to join the conversation.