@mytec: iter3.2.1 start
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import time
|
||||
import numpy as np
|
||||
from enum import Enum
|
||||
from typing import List, Tuple, Optional, Dict, Any, TYPE_CHECKING
|
||||
from dataclasses import dataclass
|
||||
from app.services.terrain_service import terrain_service
|
||||
@@ -15,6 +16,38 @@ if TYPE_CHECKING:
|
||||
from app.services.spatial_index import SpatialIndex
|
||||
|
||||
|
||||
# ── Level of Detail (LOD) for dominant path calculations ──
|
||||
|
||||
class LODLevel(Enum):
|
||||
"""Distance-based level of detail for dominant path analysis.
|
||||
|
||||
At long distances, building-level multipath contributes minimally
|
||||
to path loss — macro propagation models suffice.
|
||||
"""
|
||||
NONE = "none" # Skip dominant path entirely
|
||||
SIMPLIFIED = "simplified" # Check only nearest few buildings
|
||||
FULL = "full" # Full calculation (current behavior)
|
||||
|
||||
|
||||
# LOD distance thresholds (meters)
|
||||
LOD_THRESHOLD_NONE = 3000 # >3km: skip dominant path
|
||||
LOD_THRESHOLD_SIMPLIFIED = 1500 # 1.5-3km: simplified mode
|
||||
|
||||
# Simplified mode limits
|
||||
SIMPLIFIED_MAX_BUILDINGS = 5
|
||||
SIMPLIFIED_MAX_WALLS = 50
|
||||
|
||||
|
||||
def get_lod_level(distance_m: float) -> LODLevel:
|
||||
"""Determine LOD level based on TX-RX distance."""
|
||||
if distance_m > LOD_THRESHOLD_NONE:
|
||||
return LODLevel.NONE
|
||||
elif distance_m > LOD_THRESHOLD_SIMPLIFIED:
|
||||
return LODLevel.SIMPLIFIED
|
||||
else:
|
||||
return LODLevel.FULL
|
||||
|
||||
|
||||
@dataclass
|
||||
class RayPath:
|
||||
"""Single ray path from TX to RX"""
|
||||
|
||||
Reference in New Issue
Block a user