114514
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
"""兼容入口:本地简化训练环境。
|
||||
|
||||
HierarchicalEnv 是高层宏动作环境;LowLevelEnv 是独立八方向导航环境。
|
||||
本文件不复制实现,只转发 mcm26b.hrl 下的真实类。
|
||||
"""
|
||||
from mcm26b.hrl.hierarchical_env import HRLReward, HierarchicalEnv
|
||||
from mcm26b.hrl.low_level_env import LowLevelEnv
|
||||
|
||||
__all__ = ["HierarchicalEnv", "LowLevelEnv", "HRLReward", "make_local_env"]
|
||||
|
||||
|
||||
def make_local_env(*, problem: int = 3, stage: int = 4, seed: int | None = None,
|
||||
fidelity: str = "production"):
|
||||
"""按题目 Prompt 的四阶段编号创建训练环境。"""
|
||||
from mcm26b.hrl.curriculum import STAGES
|
||||
if not 1 <= int(stage) <= len(STAGES):
|
||||
raise ValueError(f"stage 必须在 1..{len(STAGES)}")
|
||||
env = HierarchicalEnv(problem=problem, stage=STAGES[int(stage) - 1],
|
||||
fidelity=fidelity)
|
||||
if seed is not None:
|
||||
env.reset(seed=seed)
|
||||
return env
|
||||
Reference in New Issue
Block a user