gpt4 book ai didi

drools - OptaPlanner : I tried to print out the justificationList of ConstraintMatch, 但得到了不是我的域类的 SubnetworkTuple 对象

转载 作者:行者123 更新时间:2023-12-01 19:36:58 25 4
gpt4 key购买 nike

我正在使用 OptaPlanner 来解决规划问题。我使用 drools 来计算分数。当我尝试打印出每个 constraintMatch 的 justificationList 时,除了我的域类对象之外,我得到的对象是 SubnetworkTuple 的实例。这些似乎是用于它的内部实现。

我之前没有使用过 drools 规则引擎 :) 。这是我第一次使用OptaPlanner。据我所知,justificationList 应该包含该规则中涉及的所有对象。

流口水规则:

rule "roomPriority"
when
EduClassRoomPriority($left : leftEduClass, $right : rightEduClass, $priority : priority)
exists(LectureOfEduClass(eduClass == $left,$room1 : room ) and LectureOfEduClass(eduClass == $right, $room1 != room))
then
scoreHolder.addSoftConstraintMatch(kcontext,-$priority);
end

java:

for (ConstraintMatchTotal constraintMatchTotal : constraintMatchTotals) {
String constraintName = constraintMatchTotal.getConstraintName();
Score totalScore = constraintMatchTotal.getScore();
Set<ConstraintMatch> constraintMatchSet = constraintMatchTotal.getConstraintMatchSet();
logger.info(totalScore.toShortString() + " constraint(" + constraintName + ") has " + constraintMatchSet.size() + " matches");
for (ConstraintMatch constraintMatch : constraintMatchSet) {
List<Object> justificationList = constraintMatch.getJustificationList();
Score score = constraintMatch.getScore();
logger.info(score.toShortString() + justificationList.toString());
}
}

我想知道我能做些什么来解决这个问题,因为这些额外的对象会使用户感到困惑。我可以做检查实例。但这不应该是解决它的正确方法。

先谢谢大家。

最佳答案

https://issues.jboss.org/browse/DROOLS-4423 引起并修复对于 7.26。

关于drools - OptaPlanner : I tried to print out the justificationList of ConstraintMatch, 但得到了不是我的域类的 SubnetworkTuple 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57390971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com