13.12. ホットプランニングエンティティーの視覚化
スコアに影響を与える計画エンティティーと問題の事実を強調表示するヒートマップを UI に表示します。
手順
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は、その justification オブジェクトが関係するすべての制約の合計です。複数のIndictmentエンティティーが同じConstraintMatchを共有できるため、すべてのIndictment.getScoreTotal()の合計は全体のスコアとは異なります。注記制約ストリームと Drools スコア計算は制約一致を自動的にサポートしますが、Java インクリメント演算子によるスコア計算には追加のインターフェイスを実装する必要があります。