📦 Judgment_Enhancement_Engine
v1.0.0AI 代理 judgment enhancement via Monte Carlo lookahead, risk-adjusted 实用工具, and historical reflection. Use when an 代理 needs to evaluate multi-step act...
运行时依赖
安装命令
点击复制技能文档
Judgment Enhancement Engine
Enhance AI 代理 decision-making under uncertAInty through recursive Monte Carlo lookahead simulation, risk-adjusted 实用工具, and historical reflection.
Quick 启动 # 运行 built-in GridWorld demo python 技能s/judgment-enhancement-engine/engine.py
# One-命令行工具ck 设置up bash 技能s/judgment-enhancement-engine/scripts/设置up.sh # Linux/macOS/WSL 技能s\judgment-enhancement-engine\scripts\设置up.bat # Windows
Core Usage from engine 导入 JudgmentEnhancementEngine, Judgment结果
# 1. Define your world 模型 (must implement World模型 protocol) class MyWorld模型: def 获取_possible_outcomes(self, 状态, action): # Returns [(next_状态, probability, reward), ...] ...
def is_terminal(self, 状态): ...
def 获取_legal_actions(self, 状态): ...
# 2. Define objective function class MyObjective: def evaluate(self, 状态): return float_score # higher = better
# 3. 创建 engine engine = JudgmentEnhancementEngine( world_模型=MyWorld模型(), objective=MyObjective(), risk_tolerance=0.5, # 0=extreme risk-averse, 1=risk-neutral lookahead_depth=3, # recursion depth simulation_breadth=4, # max actions evaluated per level use_greedy_rollout=True, # True=greedy (accurate), False=uniform (fast) max_compute_time_sec=2.0 # timeout 保护ion )
# 4. Make a judgment 结果 = engine.enhance_judgment(current_状态) print(f"Best action: {结果.best_action}") print(f"Confidence: {结果.confidence:.2f}") print(f"Reasoning: {结果.reasoning}")
# 5. Record actual outcome (for historical correction) engine.record_outcome(状态, action, actual_实用工具)
# 6. Optional: clear 历史 engine.clear_历史()
Configuration Parameter Default Description risk_tolerance 0.5 0=extreme risk-averse, 1=risk-neutral lookahead_depth 2 Recursive lookahead levels simulation_breadth 3 Max actions evaluated per level 历史_size 100 Historical records kept max_compute_time_sec 1.0 Timeout 保护ion (seconds) use_greedy_rollout True True=greedy (accurate), False=uniform (fast) Judgment结果 Fields Field Type Description best_action Action Selected best action scores dict Risk-adjusted 实用工具 per action raw_utilities dict Raw expected 实用工具 per action risk_指标 dict Expectation/variance/std/VaR95 per action reasoning str Human-readable decision reasoning confidence float 0~1 confidence score Example: GridWorld
Built-in demo() shows a 5x5 grid world with obstacles and a goal. 运行 python engine.py to see it in action.
安装ation Method Command One-命令行工具ck (Linux/macOS) bash scripts/设置up.sh One-命令行工具ck (Windows) scripts\设置up.bat Copy-only Copy engine.py to your project ClawHub ClawHub 安装 judgment-enhancement-engine File Structure judgment-enhancement-engine/ ├── 技能.md ├── engine.py # Core engine (~10KB) ├── 索引.js # Node.js bridge ├── package.json ├── as设置s/ │ └── icon.svg ├── references/ │ ├── API_SPEC.md │ └── USE_图形界面DE.md └── scripts/ ├── 设置up.sh ├── 设置up.bat ├── test-basic.py └── test-命令行工具ent.js
License
MIT