Skip to main content

Module criterion

Module criterion 

Source
Expand description

判据聚合:模型、读法、翻成「要跑什么」。

模型(RuleKind / Criterion)在 [model],从定义里读出判据 (criterion_of / read_criterion)在 [read],翻成要跑的东西 (RuleItem / items_of)在 [items]。端侧只 use crate::criterion:: 就能用全。

Structs§

RuleItem
一条要跑的判据:说明 + 怎么判(kind 为空即不跑,交给智能体或人)。

Enums§

Criterion
一条判据:谁判、怎么判、说明。
RuleKind
判据的种类:四种机械核对。名字与 Criterion 的四个变体一致; 线值(RuleKind::as_str)是定义里的字段名,不随变体名变。

Functions§

criterion_of
从定义里的字段认出一条判据(不校验)。
items_of
把判据翻成要跑的东西:rule 的跑,agent / human 的不跑。
read_criterion
读一条判据:取值不对、缺该有的字段,当场报错。