第149章 Dynamic Method
动态方法
核心问题:
Method 不是固定动作,而是根据当前状态生成行为条件。
传统程序通常把 Method 理解为:
Input
↓
Fixed Method
↓
Action
例如:
发现鸡蛋
↓
拿起鸡蛋
这种方法的问题在于:
同一个对象,在不同状态下不能使用完全相同的方法。
因此,ICAI 中的 Method 应当被重新定义为:
Current State
+
Goal
+
Object
+
Relation
+
Capability
↓
Dynamic Method
↓
Action Condition
149.1 Method 的动态性
Method 本身不是一个固定动作。
它更接近:
Method
=
State → Action Condition
即:
当状态发生变化时,Method 的适用条件、动作参数和动作顺序也可以发生变化。
例如机器面对一个鸡蛋。
如果:
Fragility = High
Contact = None
Goal = Move
则可能生成:
Method:
Gentle Grasp
如果:
Fragility = High
Contact = Hand
Force = Too High
则原来的 Method 不再适用。
系统需要动态调整:
Reduce Force
+
Adjust Grip
+
Slow Movement
因此:
Object
≠
Fixed Method
而是:
Object
+
Current State
→
Method
149.2 Dynamic Method 的基本结构
建立:
Dynamic Method
{
Preconditions
State Conditions
Goal Conditions
Object Conditions
Relation Conditions
Capability Conditions
Action
Parameters
Feedback
}
因此一个 Method 不只是:
Action
而是:
Conditions
+
Action
+
Parameters
+
Feedback
149.3 Method 与 State
Method 的选择必须依赖 Current State。
建立:
Current State
↓
Method Evaluation
↓
Applicable Methods
↓
Method Selection
例如:
Object = Glass
Fragility = High
Distance = 20cm
Obstacle = None
Hand State = Open
Goal = Pick Up
系统可能得到:
M1 = Fast Grasp
M2 = Gentle Grasp
M3 = Two-Finger Grasp
M4 = Supportive Grasp
然后根据当前状态进行匹配:
State
↓
Method Compatibility
↓
M2
所以:
Method Selection 是 State-Dependent 的。
149.4 Method 不是 Action
需要严格区分:
Method
与:
Action
Action:
Move Hand
Method:
Move Hand
+
Direction
+
Speed
+
Force
+
Distance
+
Stopping Condition
因此:
Action
=
What to do
Method
=
How to do it under current conditions
进一步:
Method
=
Action
+
Conditions
+
Parameters
+
Control Rules
149.5 Dynamic Method Generation
更进一步,Method 不一定必须提前完整定义。
系统可以根据当前认知状态组合已有能力:
Current State
+
Goal
+
Available Capability
↓
Method Construction
例如:
Object = Egg
Goal = Move Egg
Capability =
Detect
Reach
Grasp
Move
Release
系统可以构造:
Detect
↓
Reach
↓
Gentle Grasp
↓
Slow Move
↓
Release
于是:
Method
变成:
Capability Composition
149.6 Method Parameterization
Dynamic Method 的重要特征是:
同一个 Method 可以根据 State 修改参数。
例如:
Method = Move Object
并不是固定:
Speed = 1
Force = 1
Distance = 10
而是:
Speed = f(Object, Fragility, Obstacle, Distance)
例如:
Fragility ↑
↓
Speed ↓
Force ↓
而:
Obstacle ↑
↓
Path Complexity ↑
Speed ↓
所以:
Method
+
State
→
Parameters
149.7 Method Transition
Dynamic Method 还必须允许执行过程中发生变化。
例如:
Approach
↓
Contact
↓
Grasp
↓
Move
执行 Move 时发现:
Obstacle Detected
系统不能继续执行原来的 Method:
Move Straight
而应该:
Current Method
↓
State Change
↓
Method Re-evaluation
↓
New Method
例如:
Move Straight
↓
Obstacle
↓
Avoid Obstacle
↓
Continue Move
因此:
Method
不是一次性确定的。
而是:
Dynamic Method Loop
Observe
↓
Evaluate
↓
Select
↓
Act
↓
Feedback
↓
Re-evaluate
↓
Adjust Method
149.8 Method 与 Feedback
Dynamic Method 必须具有反馈机制。
建立:
Method
↓
Action
↓
Result
↓
Feedback
↓
State Update
↓
Method Adjustment
例如:
Target = Egg
Method = Gentle Grasp
执行后:
Force Feedback
发现:
Grip Too Weak
则:
Adjust Grip Force
如果:
Grip Too Strong
则:
Reduce Grip Force
所以:
Method
实际上形成:
Method
↔
State
而不是:
State
→
Method
一次性映射。
149.9 Dynamic Method 的认知结构
可以建立:
Perception
↓
State
↓
Goal
↓
Method Candidates
↓
Method Matching
↓
Dynamic Method
↓
Action
↓
Feedback
↓
State Update
↓
Method Update
形成闭环:
┌───────────────┐
│ Current │
│ State │
└───────┬───────┘
↓
Goal
↓
Method Candidates
↓
Method Evaluation
↓
Dynamic Method
↓
Action
↓
Environment
↓
Feedback
↓
State Update
│
└────────→ Method Update
149.10 Dynamic Method 与 Cognitive Method
前一章建立:
State
+
Goal
+
Object
+
Relation
+
Capability
↓
Method
本章进一步说明:
Method
不是最终静态结果。
而是:
Current State
+
Goal
+
Object
+
Relation
+
Capability
+
Feedback
+
Previous Method State
↓
Dynamic Method
因此 Cognitive Method 可以定义为:
一种根据当前认知状态、目标、对象、关系、能力以及执行反馈,动态确定动作条件、动作参数和动作转换规则的认知结构。
149.11 Dynamic Method 的核心公式
建立:
DMt
=
F(
St,
Gt,
Ot,
Rt,
Ct,
Mt-1,
Ft
)
其中:
DMt = 当前动态方法
St = 当前状态
Gt = 当前目标
Ot = 当前对象
Rt = 当前关系
Ct = 当前能力
Mt-1 = 上一时刻方法
Ft = 当前反馈
于是:
Dynamic Method
=
State-Dependent
+
Goal-Dependent
+
Capability-Dependent
+
Feedback-Dependent
149.12 Dynamic Method 的工程意义
对于 WSaiOS-ICAI,这意味着 Method Engine 不应该只是一个:
Action Library
而应该成为:
Method Generation
+
Method Matching
+
Method Parameterization
+
Method Transition
+
Method Feedback
组成:
Dynamic Method Engine
其运行过程可以定义为:
Input Perception
↓
Current State
↓
Goal
↓
Available Capability
↓
Generate / Retrieve Methods
↓
Evaluate
↓
Select
↓
Parameterize
↓
Execute
↓
Observe Result
↓
Update State
↓
Re-evaluate Method
最终形成:
Method 不再是“机器预先知道要做什么”,而是机器根据“现在是什么状态、想达到什么目标、拥有什么能力、刚刚发生了什么”持续生成下一步应该如何行动的认知机制。
因此,第149章可以形成一个重要的理论转折:
Fixed Method
↓
Conditional Method
↓
Adaptive Method
↓
Dynamic Method
最终:
State
+
Goal
+
Capability
+
Feedback
↓
Dynamic Method
↓
Behavior
↓
New State
↓
New Dynamic Method
这使 Method 从静态“动作程序”,提升为 持续随认知状态变化而重构的行为生成结构。