Home - VforVitorio/F1_Strat_Manager GitHub Wiki

🏎️ F1 Strategy Manager

AI-Powered Formula 1 Race Strategy Analysis and Decision Support System

πŸ“š Documentation Pages


VforVitorio/F1_Strat_Manager

DeepWiki

VforVitorio/F1_Strat_Manager

Get free private DeepWikis with

Devin

Share

Last indexed: 13 June 2025 (0638ba)

Overview

System Architecture

Installation and Setup

Documentation Workflow

Streamlit Dashboard

Strategy Recommendations View

Gap Analysis View

Radio Analysis View

Time Predictions View

Strategy Chat Interface

Machine Learning Models

Lap Time Prediction

Tire Degradation Modeling

Vision-based Gap Calculation

NLP Pipeline

Radio Transcription

Sentiment and Intent Analysis

Named Entity Recognition

Integrated NLP Pipeline

Expert System

Facts and Data Transformation

Degradation Rules

Gap Analysis Rules

Radio Message Rules

Integrated Rule Engine

Developer Guide

Data Processing Utilities

Model Artifacts and Deployment

Development Environment

Overview Relevant source files

The F1 Strategy Manager is an integrated AI-powered system for Formula 1 race strategy analysis and decision support. This document provides a technical overview of the system architecture, key components, and data flow, serving as the entry point to understand how the system works.

For detailed setup instructions, see Installation and Setup. For information on the Streamlit interface, see Streamlit Dashboard.

Purpose and Scope

The F1 Strategy Manager combines telemetry data analysis, computer vision, natural language processing, and rule-based expert systems to:

Analyze real-time race data from multiple sources

Predict lap times and tire degradation using machine learning models

Interpret team radio communications

Calculate optimal race strategies based on complex variables Provide actionable recommendations via an interactive dashboard

It targets technical race strategists who need data-driven decision support for critical race situations.

Sources:

README.md 5-11

scripts/app/app.py 60-64

System Architecture

The F1 Strategy Manager is structured as a multi-layered system with specialized components for data acquisition, processing, analysis, and visualization:

User Interface

Expert System

Data Processing Pipeline

Data Sources

FastF1 API (Race Telemetry)

OpenF1 API (Team Radio)

Race Video Footage

Gap Calculation System (YOLOv8 Vision Model)

Radio Analysis Pipeline (Sentiment + Intent + NER)

Lap Time Prediction (XGBoost Model)

Tire Degradation Prediction (TCN Model)

utils/processing.py (Data Transformation)

F1StrategyEngine (Experta Rule System)

F1DegradationRules

F1GapRules

F1LapTimeRules

F1RadioRules

F1CompleteStrategyEngine (Conflict Resolution)

app.py (Streamlit Entry Point)

recommendations_view.py

time_predictions_view.py

gap_analysis_view.py

radio_analysis_view.py

degradation_view.py

strategy_chat.py (LLM Interface)

Sources: scripts/app/app.py 8-21

README.md 14-42

Key Components

Data Sources and Processing

The system ingests and processes data from three primary sources:

Race Telemetry (FastF1): Lap times, sector data, tire information

Team Radio (OpenF1): Audio transcripts from driver-team communications Video Footage: Raw race footage for gap calculation and position tracking

Data processing is managed through the utils/processing.py module, which contains functions for transforming raw data into analysis-ready formats:

Function Purpose Source File get_processed_race_data() Transforms race telemetry with fuel adjustments and degradation metrics processing.py get_processed_gap_data() Calculates gap consistency between cars processing.py get_processed_recommendations() Loads and filters strategic recommendations processing.py calculate_gap_consistency() Determines consecutive laps with similar gap windows processing.py

Sources: scripts/app/utils/processing.py 115-130

scripts/app/utils/processing.py 173-270

Machine Learning Models

The system employs several machine learning models for predictive analytics:

XGBoost Model: Predicts lap times with MAE of 0.09s

TCN (Temporal Convolutional Network): Models tire degradation over time

YOLOv8: Computer vision model for team identification and gap calculation NLP Pipeline: Uses Whisper, RoBERTa, and BERT models for radio analysis

These models process telemetry data to generate predictions that feed into the expert system for strategic decision-making.

Sources:

README.md 31-37

Expert System

At the core of the strategy recommendation engine is a rule-based expert system built on the Experta framework. It consists of several specialized rule sets that analyze different aspects of race data:

KnowledgeEngine

F1StrategyEngine

+get_recommendations()

+record_rule_fired()

F1DegradationRules

F1LapTimeRules

F1RadioRules

F1GapRules

F1CompleteStrategyEngine

+active_systems

+init()

+get_recommendations()

+_resolve_conflicts()

Β«abstractΒ»

Fact

TelemetryFact

+driver_number

+lap_time

+tire_age

+position

DegradationFact

+degradation_rate

+predicted_rates

GapFact

+gap_ahead

+gap_behind

+consistent_gap_ahead_laps

RadioFact

+sentiment

+intent

+entities

StrategyRecommendation

+action

+confidence

+explanation

+priority

The F1CompleteStrategyEngine integrates multiple rule sets and resolves conflicts to generate coherent strategy recommendations. For more details on the expert system, see Expert System.

Sources:

README.md 38-41

Streamlit Interface

The user interface is built with Streamlit and provides multiple specialized views:

Strategy Recommendations View: Displays AI-powered recommendations

Gap Analysis View: Visualizes gaps between cars and identifies strategic opportunities

Radio Analysis View: Shows insights from team radio communications

Time Predictions View: Displays lap time predictions Tire Degradation View: Analyzes tire wear patterns and performance impacts

The UI components are organized in the components directory, with each view implemented as a separate module.

Sources: scripts/app/app.py 70-80

scripts/app/components/degradation_view.py 12-87

Data Flow

The following diagram illustrates how data flows through the system from input sources to the user interface:

Visualization

Rule Evaluation

Analysis & Prediction

Data Transformation

Input Data

FastF1 API (Race Telemetry)

OpenF1 API (Team Radio)

Race Video

utils/processing.py (get_processed_race_data)

utils/processing.py (get_processed_gap_data)

utils/processing.py (get_processed_recommendations)

Lap Time Prediction (XGBoost)

Tire Degradation (TCN)

Gap Calculation (YOLOv8)

Radio Analysis (NLP Pipeline)

F1DegradationRules

F1GapRules

F1LapTimeRules

F1RadioRules

F1CompleteStrategyEngine

utils/visualization.py

components/recommendations_view.py

components/gap_analysis_view.py

components/degradation_view.py

components/time_predictions_view.py

components/radio_analysis_view.py

Key steps in the data flow:

Data Acquisition: Raw data is collected from multiple sources

Processing: The processing.py module transforms raw data into standardized formats

Analysis: Machine learning models generate predictions and insights

Rule Evaluation: The expert system applies rules to generate recommendations Visualization: The UI components render the processed data and recommendations

Sources: scripts/app/utils/processing.py 401-427

scripts/app/utils/visualization.py 31-400

Dependencies and Requirements

The system has several key dependencies:

Python 3.10+: Base programming language

Data Analysis: pandas, numpy, matplotlib

Machine Learning: torch, xgboost, transformers, ultralytics

API Clients: fastf1, openf1

UI Framework: streamlit, plotly Expert System: experta

For a complete list of dependencies, see the requirements.txt file.

Sources: requirements.txt 1-229

README.md 52-73

Getting Started

To run the F1 Strategy Manager:

Clone the repository

Install the required dependencies Run the Streamlit application using streamlit run scripts/app/app.py

For detailed setup instructions, see Installation and Setup.

Sources:

README.md 74-100


πŸ”— Links & Resources

πŸ“ This documentation is automatically generated using browser automation.
πŸ•’ Last updated: $(date '+%Y-%m-%d %H:%M:%S UTC') πŸ“Š Auto-organized from 1 content files