Class ScoringEngine

java.lang.Object
cloud.opencode.base.rules.score.ScoringEngine

public final class ScoringEngine extends Object
Scoring Engine - Evaluates Scoring Rules and Aggregates Results 评分引擎 - 评估评分规则并聚合结果

Evaluates a collection of ScoringRules against a context, collects individual scores from rules whose conditions are satisfied, and aggregates them according to the specified AggregationStrategy.

针对上下文评估一组ScoringRule,收集条件满足的规则的单独分数, 并根据指定的AggregationStrategy进行聚合。

Since:
JDK 25, opencode-base-rules V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • score

      public static ScoreResult score(RuleContext context, Collection<ScoringRule> rules, AggregationStrategy strategy)
      Scores a collection of rules against a context using the given strategy 使用给定策略针对上下文对一组规则进行评分
      Parameters:
      context - the rule context | 规则上下文
      rules - the scoring rules | 评分规则
      strategy - the aggregation strategy | 聚合策略
      Returns:
      the score result | 评分结果
      Throws:
      NullPointerException - if any argument is null | 如果任何参数为null则抛出