likeRunner/STRUCTURE.txt
pythagodzilla 07cb1304d2 init
2026-03-19 17:57:03 +08:00

117 lines
7.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

═══════════════════════════════════════════════════════════════════════════
重构项目文件结构说明
═══════════════════════════════════════════════════════════════════════════
📁 refactored-likeRunner/
├─ 📄 README.md 【必读】完整项目说明
├─ 📄 DATA_FLOW_GUIDE.md 【必读】数据流快速参考
├─ 📄 STRUCTURE.txt 本文件
└─ src/main/kotlin/
├─ 📄 Main.kt 【程序入口】展示如何使用
├─ model/ 【数据模型层】
│ ├─ Coordinate.kt - MetaCoordinate, Coordinate, RawCoordinate, NoisyCoordinate
│ └─ MotionState.kt - PhysicsState, MotionState
├─ core/ 【核心模拟层】
│ │
│ ├─ 📄 TrajectorySimulator.kt 【主协调器】4步数据流的协调器
│ │ - 初始化各个引擎
│ │ - simulate() 执行4步处理
│ │
│ ├─ physics/ 【第1步物理计算】
│ │ └─ RunnerPhysics.kt - 计算距离、速度、加速度
│ │
│ └─ trajectory/ 【第2步路径插值】
│ └─ PathInterpolator.kt - 线性插值 (Haversine算法完全保留)
├─ noise/ 【第3步噪声处理】
│ │
│ ├─ NoiseProcessor.kt - 噪声协调器,管理多个引擎
│ │
│ └─ GpsNoiseEngine.kt - GPS噪声引擎白噪声+漂移)
│ - 预留: VelocityNoiseEngine
│ - 预留: AccelerationNoiseEngine
└─ resources/data/ 【数据资源】
└─ SampleRoute.kt - 样本轨迹数据
═══════════════════════════════════════════════════════════════════════════
4步数据流位置
═══════════════════════════════════════════════════════════════════════════
【第1步】物理计算 → RunnerPhysics.kt
┌──────────────────────────────────────┐
│ 输入: time (秒) │
│ 处理: 计算物理参数 │
│ 输出: PhysicsState │
│ - distance (距离) │
│ - velocity (速度) │
│ - acceleration (加速度) │
└──────────────────────────────────────┘
【第2步】路径插值 → PathInterpolator.kt
┌──────────────────────────────────────┐
│ 输入: distance (来自第1步) │
│ 处理: 在轨迹上查找坐标 │
│ 输出: RawCoordinate │
│ - lon, lat (无噪声) │
└──────────────────────────────────────┘
【第3步】噪声处理 → NoiseProcessor.kt + GpsNoiseEngine.kt
┌──────────────────────────────────────┐
│ 输入: RawCoordinate + PhysicsState │
│ 处理: 添加各种噪声 │
│ 输出: NoisyCoordinate │
│ - lon, lat (带噪声) │
│ - gpsError (噪声大小) │
└──────────────────────────────────────┘
【第4步】结果组装 → TrajectorySimulator.kt
┌──────────────────────────────────────┐
│ 输入: 所有前置步骤的输出 │
│ 处理: 组装到单一对象 │
│ 输出: MotionState │
│ (完整的运动状态,可直接使用) │
└──────────────────────────────────────┘
═══════════════════════════════════════════════════════════════════════════
核心特性
═══════════════════════════════════════════════════════════════════════════
✅ 清晰的数据流
每个步骤职责明确,输入输出清晰
✅ 易于扩展
预留了位置供添加新的噪声引擎、物理模型等
✅ 逻辑保留
原有算法Haversine、GPS噪声模型逻辑完全保持
✅ 充分注释
每个关键类都有详细的伪代码和说明
✅ 独立项目
新项目完全独立,不影响原有的 likeRunner 项目
═══════════════════════════════════════════════════════════════════════════
快速导航
═══════════════════════════════════════════════════════════════════════════
我想... 去看...
─────────────────────────────────────────────────────────────
了解整个项目 → README.md
理解数据流 → DATA_FLOW_GUIDE.md
看代码怎么用 → Main.kt
改物理计算 → core/physics/RunnerPhysics.kt
改路径算法 → core/trajectory/PathInterpolator.kt
加新噪声 → noise/GpsNoiseEngine.kt
改坐标数据结构 → model/Coordinate.kt
看最终输出数据 → model/MotionState.kt
怎么协调各步骤 → core/TrajectorySimulator.kt
═══════════════════════════════════════════════════════════════════════════