data_to_rl_config.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. # ============================================================
  2. # 项目级路径配置
  3. # ============================================================
  4. Paths:
  5. project_root: "E:/Greentech"
  6. __comment__: >
  7. 项目根目录,所有路径均相对于该目录展开。
  8. 不同工程师只需修改这一项即可迁移环境。
  9. raw_data:
  10. filtered_cycles_dir: "models/uf-rl/datasets/UF_xishan_data/processed/filter_segments"
  11. cycle_file_pattern: "UF{unit}_filtered_cycles.csv"
  12. enabled_units: [1, 2, 4]
  13. disabled_units: [3]
  14. __comment__: >
  15. 已完成清洗与周期切分的真实工厂数据。
  16. 每个 CSV 对应一个机组,文件内每一行是一个【物理周期】。
  17. data_to_rl 阶段会:
  18. - 读取 enabled_units 中所有机组
  19. - 合并为统一数据集
  20. - 机组编号仅用于筛选,不进入状态空间
  21. data_to_rl:
  22. output_dir: "models/uf-rl/datasets/UF_xishan_data/rl_ready/output"
  23. cache_dir: "models/uf-rl/datasets/UF_xishan_data/rl_ready/cache"
  24. __comment__: >
  25. data_to_rl 模块输出内容:
  26. - 全机组合并后的状态空间范围
  27. - reset 初始状态分布
  28. - reward 统计量
  29. # ============================================================
  30. # 数据层级定义(非常重要)
  31. # ============================================================
  32. DataHierarchy:
  33. physical_cycle:
  34. id_column: "seg_id"
  35. time_columns:
  36. start: "start_time"
  37. end: "end_time"
  38. __comment__: >
  39. 物理周期是最细粒度的数据层级:
  40. - 用于物理模型验证
  41. - 用于环境内部子步模拟
  42. - 不直接暴露给强化学习算法
  43. chemical_cycle:
  44. id_column: "chem_cycle_id"
  45. validity_column: "chem_cycle_valid"
  46. step_definition: "one_rl_step_per_chemical_cycle"
  47. __comment__: >
  48. 化学周期是强化学习的【唯一 step 单位】。
  49. 强化学习中:
  50. - 一个 step = 一个化学周期
  51. - 一个状态 = 一个化学周期的整体状态
  52. # ============================================================
  53. # 强化学习状态定义(工程师重点关注)
  54. # ============================================================
  55. RLState:
  56. level: chemical_cycle
  57. dimension: 8
  58. __comment__: >
  59. 强化学习 observation 的定义。
  60. 所有变量在一个 step(化学周期)内保持不变。
  61. variables:
  62. q_UF:
  63. source: "flow_mean"
  64. aggregation: "mean_within_cycle"
  65. unit: "m3_per_h"
  66. description: "化学周期代表性进水流量"
  67. __comment__: >
  68. 原始数据在物理周期层级变化,
  69. 这里使用化学周期内的平均值作为状态。
  70. temp:
  71. source: "temp_mean"
  72. aggregation: "mean_within_cycle"
  73. unit: "celsius"
  74. description: "化学周期代表性水温"
  75. TMP:
  76. source: "tmp_start"
  77. selection: "first_physical_cycle"
  78. unit: "MPa"
  79. description: "化学周期起始跨膜压差"
  80. __comment__: >
  81. 虽然 TMP 在物理周期内会变化,
  82. 但强化学习只关心化学周期开始时的状态。
  83. R:
  84. source: "R_scaled_start"
  85. selection: "first_physical_cycle"
  86. unit: "scaled_resistance"
  87. description: "化学周期起始膜阻力"
  88. nuK:
  89. source: "cycle_nuK"
  90. unit: "scaled"
  91. description: "短期污染增长系数"
  92. __comment__: >
  93. 在同一化学周期内视为常数,
  94. 后续 step (下一化学周期)中根据动作进行经验性更新。
  95. slope:
  96. source: "cycle_long_a"
  97. unit: "scaled"
  98. description: "长期不可逆污染幂律系数 a"
  99. power:
  100. source: "cycle_long_b"
  101. unit: "dimensionless"
  102. description: "长期不可逆污染幂律指数 b"
  103. ceb_removal:
  104. source: "cycle_R_removed"
  105. unit: "scaled"
  106. description: "CEB 可去除的膜阻力"
  107. # ============================================================
  108. # 状态空间范围提取(reset 使用)
  109. # ============================================================
  110. StateSpaceExtraction:
  111. enabled: true
  112. level: chemical_cycle
  113. include_only_valid_cycles: true
  114. __comment__: >
  115. 用真实工厂数据统计【合理状态空间范围】,
  116. 用于:
  117. - reset 初始状态采样
  118. - 状态边界 sanity check
  119. statistics:
  120. method: "empirical"
  121. percentiles: [1, 5, 50, 95, 99]
  122. __comment__: >
  123. 使用经验分布统计,避免假设正态分布。
  124. output:
  125. save_csv: true
  126. filename: "state_space_bounds.csv"
  127. # ============================================================
  128. # 物理周期层级的用途声明
  129. # ============================================================
  130. PhysicalCycleUsage:
  131. enabled: true
  132. purposes:
  133. - internal_simulation
  134. - parameter_sanity_check
  135. - post_training_validation
  136. variables_available:
  137. - R_scaled_start
  138. - R_scaled_end
  139. - tmp_start
  140. - tmp_end
  141. - flow_mean
  142. - flow_std
  143. - temp_mean
  144. - temp_std
  145. __comment__: >
  146. 物理周期数据:
  147. ✔ 可用于环境内部计算
  148. ✔ 可用于训练后验证
  149. ✘ 不可作为 RL observation
  150. # ============================================================
  151. # 真实数据在强化学习中的角色(工程边界声明)
  152. # ============================================================
  153. RealDataUsagePolicy:
  154. reset_initialization:
  155. enabled: true
  156. source: "chemical_cycle_state_distribution"
  157. __comment__: >
  158. reset 时从真实化学周期状态分布中采样,
  159. 确保训练从“现实可达状态”开始。
  160. training:
  161. use_real_transitions: false
  162. __comment__: >
  163. 真实数据不用于:
  164. - 动力学拟合
  165. - 监督策略
  166. 强化学习仍在模拟环境中进行。
  167. validation:
  168. enabled: true
  169. compare_with_real_cycles: true
  170. __comment__: >
  171. 训练完成后:
  172. - 将策略运行结果
  173. - 与真实化学周期统计特性进行对比
  174. 用于评估策略的现实可行性与安全性。
  175. # ============================================================
  176. # 方法论与工程风险声明
  177. # ============================================================
  178. MethodologyNotes:
  179. - "强化学习的 step 定义严格等同于一个化学周期"
  180. - "所有 RL 状态变量在一个 step 内视为常数"
  181. - "物理周期层级仅用于环境内部模拟"
  182. - "真实数据用于分布约束与验证,而非动力学建模"