How adam-lagoda/p10 works
Project type and purpose
• This is a research‐grade, full-stack Python project for Active Heave Compensation using Deep Reinforcement Learning (DRL). It provides:
• A custom “boat” environment modeling heave dynamics and waves
• Simulation scripts
• Training pipelines for multiple RL algorithms (DDPG, DQN, PPO, SAC, TD3)
• Validation and analysis modules
• Separate wave‐prediction models (CNN/LSTM)
• Utility scripts for R² analysis and wave visualization
Top-level components
• Environment & Simulation
• buoyantboat/env: core physics and wave-generation modules
• buoyantboat/simulate: simulate without control
• Training
• buoyantboat/train: five algorithm‐specific scripts
• environment.yml: reproducible Python/Micromamba environment
• Validation & Analysis
• buoyantboat/validate: per‐algorithm test scripts + CSV data
• misc/r2: R² metrics on saved states
• Policy Storage & Logging
• trained_policies/converged: model archives, TensorBoard events, loss & reward CSVs
• Wave Prediction
• wave_prediction: CNN & LSTM prediction scripts
• Utilities
• misc/wavegen.py: animated wave generator
1. “Python Execution Environment”
– Micromamba/Python (environment.yml)
2. “Boat Environment”
– boat_env.py (equations)
– dh_transform.py, wave_generator.py, winch.py
3. “Simulator”
– simulate.py (no‐control baseline)
4. “Training Pipeline”
– boat_ddpg.py, boat_dqn.py, boat_ppo.py, boat_sac.py, boat_td3.py
– Uses Stable-Baselines3 or custom RL loops
5. “Validation Pipeline”
– ddpg_test.py, dqn_test.py, ppo_test.py, sac_test.py
– Produces CSV logs, uses real/synthetic wave data
6. “Policy Storage”
– saves .zip models, TensorBoard event files, CSV metrics
7. “Analysis Utilities”
– misc/r2 scripts: R² performance plots
– misc/wavegen: animated wave for reports
8. “Wave Prediction”
– wave_prediction_cnn.py, wave_prediction_lstm.py
– Python Env → (loads) → Boat Environment
– Boat Environment → (simulates) → Simulator → (data) → Training Pipeline
– Training → (saves) → Policy Storage
– Policy Storage → (model) → Validation Pipeline → (metrics) → CSV files
– CSV / event logs → Analysis Utilities → (plots)
– Real wave data → Wave Prediction → (predicted wave) → can feed back into Environment or Validation
c. Architectural patterns
• Modular separation: env / simulate / train / validate / predict
• Data‐driven pipelines: clear input/output (CSV, .zip, TensorBoard events)
• Reproducible environment (environment.yml)
d. Key technologies
– Python 3.x, Micromamba/YAML
– NumPy/SciPy for physics
– Stable Baselines3 or custom RL loops
– TensorBoard for logging
– pandas/Matplotlib for CSV analysis
– PyTorch or TensorFlow for CNN/LSTM
Emphasize
• Every directory as a distinct component
• Dependency on environment.yml at the top