13.12. 视觉化热计划实体

在 UI 中显示 heat 映射,它突出显示了对分数影响的规划实体和问题事实。

流程

  • ScoreExplanation 中获取 Indictment 映射:

    Map<Object, Indictment<HardSoftScore>> indictmentMap = scoreExplanation.getIndictmentMap();
    for (CloudProcess process : cloudBalance.getProcessList()) {
        Indictment<HardSoftScore> indictment = indictmentMap.get(process);
        if (indictment == null) {
            continue;
        }
        // The score impact of that planning entity
        HardSoftScore totalScore = indictment.getScore();
    
        for (ConstraintMatch<HardSoftScore> constraintMatch : indictment.getConstraintMatchSet()) {
            String constraintName = constraintMatch.getConstraintName();
            HardSoftScore score = constraintMatch.getScore();
            ...
        }
    }

    每个字典 都是涉及合理对象的所有限制总和。所有 Indictment.getScoreTotal () 的总和与整体分数不同,因为多个字典实体可以共享相同的 ConstraintMatch

    注意

    约束流和 Drools 分数计算支持约束自动匹配,但增量 Java 分数计算需要实施额外的接口。