Interface ScoringRule
- All Superinterfaces:
Comparable<Rule>, Rule
Scoring Rule - Rule That Produces a Numeric Score
评分规则 - 产生数值分数的规则
Extends Rule to add scoring capability. When a rule's condition evaluates
to true, the score(RuleContext) method computes a numeric score that can
be aggregated by a ScoringEngine.
扩展Rule以添加评分能力。当规则的条件评估为真时,
score(RuleContext)方法计算一个可被ScoringEngine聚合的数值分数。
- Since:
- JDK 25, opencode-base-rules V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Field Summary
Fields inherited from interface Rule
DEFAULT_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptiondoublescore(RuleContext context) Computes the score for this rule in the given context 在给定上下文中计算此规则的分数default doubleweight()Returns the weight of this rule for weighted aggregation 返回此规则用于加权聚合的权重Methods inherited from interface Rule
compareTo, evaluate, execute, getDescription, getGroup, getName, getPriority, isEnabled, isTerminal
-
Method Details
-
score
Computes the score for this rule in the given context 在给定上下文中计算此规则的分数- Parameters:
context- the rule context | 规则上下文- Returns:
- the computed score | 计算的分数
-
weight
default double weight()Returns the weight of this rule for weighted aggregation 返回此规则用于加权聚合的权重- Returns:
- the weight, defaults to 1.0 | 权重,默认为1.0
-