01 01 system architecture - VforVitorio/F1_Strat_Manager GitHub Wiki
System Architecture
VforVitorio/F1_Strat_Manager powered by Devin
- Overview
- System Architecture
- Installation and Setup
- 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
- Expert System
- Degradation Rules
- Gap Analysis Rules
- Radio Message Rules
- Integrated Rule Engine
- Developer Guide
- API Reference
- Integration Guide
System Architecture
Relevant source files
- .gitignore
- README.md
- requirements.txt
- scripts/IS_agent/N06_rule_merging.ipynb
- scripts/IS_agent/utils/N06_rule_merging.py
- scripts/app/app.py
- scripts/app/components/degradation_view.py
- scripts/app/utils/processing.py
- scripts/app/utils/visualization.py This document provides a comprehensive overview of the F1 Strategy Manager's system architecture, explaining how different components interact to deliver strategic recommendations for Formula 1 racing. The architecture combines data acquisition, machine learning models, natural language processing, expert systems, and visualization components into a cohesive application. For information about installing and setting up the system, see Installation and Setup.
1. High-Level Architecture Overview
The F1 Strategy Manager follows a layered architecture where data flows from external sources through processing pipelines to an expert system that generates recommendations, which are then presented through a Streamlit dashboard.
System Components Diagram
Data Flow Architecture
2. Data Sources and Processing Pipeline
The system integrates multiple data sources that are processed through specialized pipelines before being transformed into facts for the expert system.
Data Sources
The F1 Strategy Manager relies on three primary data sources:
- FastF1 API: Provides official F1 telemetry data including lap times, tire usage, and driver position
- OpenF1 API: Provides team radio communications between drivers and engineers
- Race Video Footage: Used for visual gap calculation between cars
Processing Components
Fact Transformation Pipeline
A critical aspect of the architecture is the transformation of raw data into facts that can be processed by the expert system rule engine:
3. Expert System Architecture
The expert system is the core decision-making component that evaluates facts, applies domain-specific rules, and generates strategy recommendations.
Class Hierarchy
Fact Classes Structure
Rule Conflict Resolution Process
4. Streamlit Dashboard Architecture
The user interface is built with Streamlit and organized into multiple views for different aspects of strategy analysis.
Dashboard Component Structure
Data Processing Flow Within Dashboard
5. Integration Points
The system uses several integration mechanisms to connect components across different layers.
Session State Management
Streamlit's session state is used to manage application state and data caching:
Fact Transformation and Rule Execution
The integration between data processing and the expert system is managed through fact transformation:
6. Technologies and Dependencies
The system relies on a wide range of technologies and libraries to deliver its functionality:
Component | Technologies | Purpose |
---|---|---|
Data Sources | FastF1, OpenF1, OpenCV | Retrieve race data and process video |
ML Models | XGBoost, PyTorch (TCN), YOLOv8 | Prediction and computer vision |
NLP Pipeline | Whisper, BERT, RoBERTa | Audio transcription and text analysis |
Expert System | Experta (Python rule engine) | Rule-based strategy generation |
Dashboard | Streamlit, Plotly | Interactive visualization |
Data Processing | Pandas, NumPy | Data manipulation and analysis |
7. System Initialization Sequence
The startup sequence of the application is managed through app.py, which initializes all the necessary components:
Summary
The F1 Strategy Manager's architecture integrates multiple data sources and processing pipelines through a modular design centered around an expert system. The system:
- Collects data from FastF1, OpenF1, and race video
- Processes this data through specialized pipelines for gap calculation, radio analysis, lap time prediction, and tire degradation modeling
- Transforms processed data into facts for the rule engine
- Applies domain-specific rules through the F1CompleteStrategyEngine
- Resolves conflicts between competing strategy recommendations
- Presents the results through an interactive Streamlit dashboard This architecture enables the system to provide comprehensive strategy recommendations that take into account all aspects of Formula 1 racing, from tire wear to gap dynamics and team communications.
On this page
- System Architecture
- 1. High-Level Architecture Overview
- System Components Diagram
- Data Flow Architecture
- 2. Data Sources and Processing Pipeline
- Data Sources
- Processing Components
- Fact Transformation Pipeline
- 3. Expert System Architecture
- Class Hierarchy
- Fact Classes Structure
- Rule Conflict Resolution Process
- 4. Streamlit Dashboard Architecture
- Dashboard Component Structure
- Data Processing Flow Within Dashboard
- 5. Integration Points
- Session State Management
- Fact Transformation and Rule Execution
- 6. Technologies and Dependencies
- 7. System Initialization Sequence
- Summary