01 01 system architecture - VforVitorio/F1_Strat_Manager GitHub Wiki

System Architecture

VforVitorio/F1_Strat_Manager powered by Devin

System Architecture

Relevant source files

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:

  1. FastF1 API: Provides official F1 telemetry data including lap times, tire usage, and driver position
  2. OpenF1 API: Provides team radio communications between drivers and engineers
  3. 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:

  1. Collects data from FastF1, OpenF1, and race video
  2. Processes this data through specialized pipelines for gap calculation, radio analysis, lap time prediction, and tire degradation modeling
  3. Transforms processed data into facts for the rule engine
  4. Applies domain-specific rules through the F1CompleteStrategyEngine
  5. Resolves conflicts between competing strategy recommendations
  6. 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