File Reference radarsimrunner
File Reference radar_sim_runner
Path: Project v1/src/radar_sim/runner.py
1. Purpose
هذا الملف جزء من نواة HDDS ويخدم طبقة وظيفية محددة داخل منظومة Radar/Audio/GUI orchestration.
2. Responsibilities
- احتواء منطق المجال الخاص بهذا الملف.
- توفير API داخلي لباقي الوحدات.
- تنفيذ جزء من Runtime pipeline.
3. Imports Analysis
- 3:from future import annotations
- 5:import argparse
- 6:from dataclasses import dataclass
- 7:from pathlib import Path
- 9:import numpy as np
- 11:from .channel import simulate_surveillance_matrix
- 12:from .constants import AppConfig, ScenarioConfig, load_app_config
- 13:from .detection import DetectionResult, ca_cfar_2d
- 14:from .logging_utils import project_root, write_run_log
- 15:from .metrics import TruthTarget, match_detection_to_truth, scenario_truth
- 16:from .plotting import plot_processing_summary
- 17:from .processing import ProcessingResult, process_reference_and_surveillance
- 18:from .scenarios import get_scenario, list_scenarios
- 19:from .waveform import generate_reference_matrix
4. Main Classes
- 23:class ScenarioRunResult:
5. Main Functions
- 30:def default_config_path() -> Path:
- 35:def format_report(
- 79:def execute_scenario(
- 115:def run_named_scenario(
- 151:def build_parser() -> argparse.ArgumentParser:
- 179:def main() -> None:
تحليل الدوال (منهج عام):
- input: معاملات runtime/config/data structures.
- output: dataclasses/arrays/reports/state updates.
- algorithm: يعتمد على نوع الملف (DSP/ML/GUI/control flow).
- side effects: I/O، logging، GUI updates، أو model loading.
- runtime behavior: دوال critical قد تنفذ per-frame أو per-window.
6. Internal Workflow
- تهيئة البيانات أو الإعدادات.
- تطبيق المعالجة الأساسية.
- إعادة النتائج أو تحديث state خارجي.
7. Data Flow
- inbound: من ملفات config أو callers أعلى.
- processing: transformations حسب domain.
- outbound: structures تستخدمها ملفات أخرى أو GUI.
8. Mathematical Concepts
إذا كان الملف Radar/Audio DSP فإنه يستخدم مفاهيم مثل FFT, Doppler Shift, log-Mel, thresholding حسب السياق.
9. Important Variables
10. Integration Points
- Used By: يعتمد على استدعاءات بقية النظام لهذا الملف.
- Calls: وحدات داخلية وخارجية (NumPy/TensorFlow/PyTorch/OpenCV).
11. Runtime Sequence
ينفذ هذا الملف ضمن التسلسل العام الموضح في Runtime Execution Flow.
12. Error Handling
- يعتمد على
raise/exceptions المحلية في الملف. - في GUI يتم غالبًا احتواء الخطأ عبر dialogs أو status messages.
13. Performance Notes
- الملفات التشغيلية per-frame/per-window حساسة للأداء.
- عمليات ML inference وFFT هي الأعلى كلفة عادة.
14. Future Improvements
- إضافة profiling موحد.
- توحيد metrics logging.
- تقليل التكرار بين و عند الإمكان.
15. Related Notes
Metadata
- Source path: Project v1/src/radar_sim/runner.py
- Lines: 198