radio message rules - VforVitorio/F1_Strat_Manager GitHub Wiki

Radio Message Rules

VforVitorio/F1_Strat_Manager

powered by

Devin

Radio Message Rules

This page documents the radio message rules component of the F1 Strategy Manager system. These rules analyze natural language communications from team radio to generate strategic recommendations. For information about other rule systems, see Degradation Rules, Gap Analysis Rules, or the complete Integrated Rule Engine.

1. Overview

The Radio Message Rules subsystem leverages Natural Language Processing (NLP) to extract valuable strategic information from team radio communications. This component connects the qualitative driver and team feedback with the quantitative race analysis, enabling a more comprehensive strategy engine.

2. NLP Pipeline Architecture

The radio message analysis pipeline transforms unstructured radio communications into structured data using a three-model approach:

  1. Sentiment Analysis: Determines emotional tone (positive, negative, neutral)
  2. Intent Classification: Categorizes communication purpose (ORDER, INFORMATION, etc.)
  3. Named Entity Recognition: Extracts specific entities (actions, situations, incidents)

2.1. Sentiment Analysis Model

The sentiment model classifies radio messages into three categories:

  • Positive
  • Negative
  • Neutral

2.2. Intent Classification Model

The intent model categorizes messages into five types:

  • INFORMATION: Factual updates about race conditions
  • PROBLEM: Driver-reported issues
  • ORDER: Direct instructions to the driver
  • WARNING: Alerts about potential issues
  • QUESTION: Queries requiring driver input

2.3. Named Entity Recognition

The NER model identifies key entities in radio messages using the BIO (Beginning-Inside-Outside) tagging scheme:

Entity Type Description
ACTION Direct commands or actions
SITUATION Racing context descriptions
INCIDENT Accidents or on-track events
STRATEGY_INSTRUCTION Strategic directives
POSITION_CHANGE References to positions
PIT_CALL Calls for pit stops
TRACK_CONDITION Track state mentions
TECHNICAL_ISSUE Car-related problems
WEATHER Weather conditions

2.4. Pipeline Integration

The complete pipeline combines these models to produce structured data:

Example structured output:

3. Radio Rules Implementation

The F1RadioRules class extends the base F1StrategyEngine and implements three main rules that trigger specific strategy recommendations based on radio analysis.

3.1. Grip Issue Response Rule

This rule detects when a driver reports grip problems or technical issues with the car.

Conditions:

  • Radio message has negative sentiment
  • Contains grip-related terms or TECHNICAL_ISSUE entities

Action:

  • Recommends prioritizing a pit stop with 85% confidence
  • Medium-high priority (2 out of 3)

3.2. Weather Information Adjustment Rule

This rule identifies when weather changes are reported that might require strategy adjustments.

Conditions:

  • Contains WEATHER entities
  • OR contains TRACK_CONDITION entities mentioning "wet"

Action:

  • Recommends preparing rain tires with 90% confidence
  • High priority (3 out of 3)

3.3. Incident Reaction Rule

This rule detects safety car deployments or yellow flag situations.

Conditions:

  • Contains INCIDENT entities with "safety" reference
  • OR contains SITUATION entities with "yellow" reference

Action:

  • Recommends reevaluating pit window with 85% confidence
  • High priority (3 out of 3)

4. Integration Flow

The following diagram illustrates how radio messages are processed by the system, from input to strategy recommendation:

5. Example Usage and Testing

The system can be tested with different radio message scenarios to verify rule activation:

The test_radio_rules function demonstrates the full pipeline:

  1. Analyze the radio message using NLP
  2. Create a RadioFact from the analysis
  3. Run the F1RadioRules engine with the fact
  4. Return strategy recommendations

6. Transcription Capability

For processing audio radio communications, the system includes a transcription module based on OpenAI's Whisper model:

The transcription process converts audio messages to text before running them through the same analysis pipeline.

Example usage:

7. Performance and Limitations

The Radio Message Rules system has the following characteristics:

  1. Strengths:

    • Integrates qualitative driver feedback into quantitative strategy
    • Handles both text and audio inputs
    • Rapidly identifies critical race conditions (weather, incidents)
  2. Limitations:

    • Effectiveness depends on NLP model accuracy
    • Relies on specific linguistic patterns and keywords
    • May miss nuanced or complex communications
  3. Error Handling:

    • Confidence scores indicate rule certainty
    • Rules prioritize recommendations (1-3 scale)
    • System can function with partial information

On this page