GFDecisionScore¶
API Reference / Decision / 类索引
- 路径:
addons/gf/extensions/decision/runtime/gf_decision_score.gd - 模块:
Decision - 继承:
RefCounted - API:
public - 类别:值对象 (
value_object) - 首次版本:
4.3.0
单个候选决策的评分结果。 保存候选 ID、最终分数、考虑项明细和元数据,便于测试、调试面板或导演系统审计。
成员概览¶
| 类型 | 名称 | 签名 |
|---|---|---|
| 属性 | decision |
var decision: GFDecisionOption = null |
| 属性 | decision_id |
var decision_id: StringName = &"" |
| 属性 | score |
var score: float = 0.0 |
| 属性 | accepted |
var accepted: bool = false |
| 属性 | consideration_scores |
var consideration_scores: Array[Dictionary] = [] |
| 属性 | metadata |
var metadata: Dictionary = {} |
| 方法 | to_dictionary |
func to_dictionary() -> Dictionary: |
| 方法 | get_debug_snapshot |
func get_debug_snapshot() -> Dictionary: |
属性¶
decision¶
- API:
public
被评分的候选决策。
decision_id¶
- API:
public
候选决策标识。
score¶
- API:
public
最终分数。
accepted¶
- API:
public
该候选是否可被选择。
consideration_scores¶
- API:
public
考虑项评分明细。
结构:
consideration_scores: Array[Dictionary],每项包含 consideration_id、score、weight 和 weighted_score 字段。
metadata¶
- API:
public
候选决策元数据副本。
结构:
metadata: Dictionary[StringName, Variant] copied from the scored decision option.
方法¶
to_dictionary¶
- API:
public
转换为字典。
返回:评分结果字典。
结构:
return: 包含 decision_id、score、accepted、consideration_scores 和 metadata 字段的 Dictionary。
get_debug_snapshot¶
- API:
public
获取调试快照。
返回:调试快照字典。
结构:
return: 与 to_dictionary() 相同的评分结果 Dictionary。