Spaces:
Sleeping
Sleeping
File size: 2,987 Bytes
8094b21 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | from pydantic import BaseModel, Field
from typing import List, Optional, Literal
class NavalThreatAssessment(BaseModel):
"""
Tactical threat assessment for a detected object in a maritime environment.
"""
# 1. Classification
vessel_category: Literal["Warship", "Commercial", "Fishing", "Recreational", "Small Boat", "Aircraft", "Unknown"] = Field(..., description="Broad category of the vessel/object.")
specific_class: Optional[str] = Field(None, description="Specific class if identifiable (e.g., 'Arleigh Burke', 'Dhow', 'Skiff').")
# 2. Identification
identity_markers: List[str] = Field(default_factory=list, description="Visible identifiers: Hull Numbers, Names, Flags, Funnel markings.")
flag_state: Optional[str] = Field(None, description="Country of origin based on flag or markings.")
# 3. Capabilities & Weapons
visible_weapons: List[str] = Field(default_factory=list, description="Visible weaponry: 'Deck Gun', 'VLS', 'Torpedo Tubes', 'Crew Served Weapons'.")
weapon_readiness: Literal["Stowed/PEACE", "Manned/Tens", "Trained/Aiming", "Firing/HOSTILE", "Unknown"] = Field(..., description="State of visible weapons.")
# 4. Sensors & Electronics
sensor_profile: List[str] = Field(default_factory=list, description="Visible sensors: 'Rotating Search Radar', 'Fire Control Director', 'Dome'.")
# 5. Kinematics
motion_status: Literal["Dead in Water", "Stationary/Anchored", "Underway Slow", "Underway Fast", "Flank Speed"] = Field(..., description="Movement status based on wake and bow wave.")
wake_description: Optional[str] = Field(None, description="Description of the wake (e.g., 'Large turbulent wake', 'No wake').")
# 6. Spatial / Geometry
aspect: str = Field(..., description="Target aspect relative to sensor: 'Bow-on', 'Stern-on', 'Broadside Port', 'Broadside Starboard'.")
range_estimation_nm: float = Field(..., description="Estimated range in Nautical Miles.")
bearing_clock: str = Field(..., description="Relative bearing in clock format (12 o'clock = Bow).")
# 7. Operational Context
deck_activity: str = Field("None", description="Activity on deck: 'Flight Ops', 'Cargo Handling', 'Personnel gathering', 'Empty'.")
special_features: List[str] = Field(default_factory=list, description="Anomalies: 'Rust streaks', 'Camouflage', 'Antenna forest', 'RHIBs on davits'.")
# 8. Threat Assessment
threat_level_score: int = Field(..., ge=1, le=10, description="1-10 Threat Score (1=Benign, 10=Imminent Attack).")
threat_classification: Literal["Friendly", "Neutral", "Suspect", "Hostile"] = Field(..., description="Tactical classification.")
tactical_intent: str = Field(..., description="Inferred intent: 'Transit', 'Intelligence Gathering', 'Harassment', 'Attack Profile'.")
class FrameThreatAnalysis(BaseModel):
objects: dict[str, NavalThreatAssessment] = Field(..., description="Map of Object ID (e.g., 'T01') to its assessment.")
|