本文整理了Java中org.kie.api.definition.rule.Rule.getPackageName
方法的一些代码示例,展示了Rule.getPackageName
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.getPackageName
方法的具体详情如下:
包路径:org.kie.api.definition.rule.Rule
类名称:Rule
方法名:getPackageName
[英]Returns the package name (namespace) this rule is tied to.
[中]返回与此规则关联的包名(命名空间)。
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, int weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Integer> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, BigDecimal weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, BigDecimal> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, double weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Double> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, BigDecimal weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, BigDecimal> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, long weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Long> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, int weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Integer> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, int weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Integer> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, BigDecimal weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, BigDecimal> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, long weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Long> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, double weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Double> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, int weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Integer> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, BigDecimal weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, BigDecimal> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, long weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Long> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the weightMultiplier for all score levels.
* @param kcontext never null, the magic variable in DRL
* @param weightMultiplier at least 0
*/
public void reward(RuleContext kcontext, long weightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, Long> matchExecutor = matchExecutorByNumberMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, weightMultiplier);
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the specific weightMultiplier per score level.
* Slower than {@link #reward(RuleContext, BigDecimal)}.
* @param kcontext never null, the magic variable in DRL
* @param hardWeightMultiplier at least 0
* @param softWeightMultiplier at least 0
*/
public void reward(RuleContext kcontext, BigDecimal hardWeightMultiplier, BigDecimal softWeightMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, HardSoftBigDecimalScore> matchExecutor = matchExecutorByScoreMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, HardSoftBigDecimalScore.of(hardWeightMultiplier, softWeightMultiplier));
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the specific weightMultiplier per score level.
* Slower than {@link #reward(RuleContext, int)}.
* @param kcontext never null, the magic variable in DRL
* @param hardWeightsMultiplier elements at least 0
* @param softWeightsMultiplier elements at least 0
*/
public void reward(RuleContext kcontext, int[] hardWeightsMultiplier, int[] softWeightsMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, BendableScore> matchExecutor = matchExecutorByScoreMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, BendableScore.of(hardWeightsMultiplier, softWeightsMultiplier));
}
代码示例来源:origin: kiegroup/optaplanner
/**
* Reward a match by the {@link ConstraintWeight} multiplied with the specific weightMultiplier per score level.
* Slower than {@link #reward(RuleContext, BigDecimal)}.
* @param kcontext never null, the magic variable in DRL
* @param hardWeightsMultiplier elements at least 0
* @param softWeightsMultiplier elements at least 0
*/
public void reward(RuleContext kcontext, BigDecimal[] hardWeightsMultiplier, BigDecimal[] softWeightsMultiplier) {
Rule rule = kcontext.getRule();
BiConsumer<RuleContext, BendableBigDecimalScore> matchExecutor = matchExecutorByScoreMap.get(rule);
if (matchExecutor == null) {
throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName()
+ ") does not match a @" + ConstraintWeight.class.getSimpleName() + " on the @"
+ ConstraintConfiguration.class.getSimpleName() + " annotated class.");
}
matchExecutor.accept(kcontext, BendableBigDecimalScore.of(hardWeightsMultiplier, softWeightsMultiplier));
}
代码示例来源:origin: kiegroup/optaplanner
private ConstraintMatchTotal findConstraintMatchTotal(RuleContext kcontext) {
Rule rule = kcontext.getRule();
String constraintPackage = rule.getPackageName();
String constraintName = rule.getName();
String constraintId = constraintPackage + "/" + constraintName;
return constraintMatchTotalMap.computeIfAbsent(constraintId,
k -> new ConstraintMatchTotal(constraintPackage, constraintName, null, zeroScore));
}
代码示例来源:origin: kiegroup/optaplanner
@Override
public void configureConstraintWeight(Rule rule, Score_ constraintWeight) {
if (constraintWeight.getInitScore() != 0) {
throw new IllegalStateException("The initScore (" + constraintWeight.getInitScore() + ") must be 0.");
}
if (constraintMatchEnabled) {
String constraintPackage = rule.getPackageName();
String constraintName = rule.getName();
String constraintId = constraintPackage + "/" + constraintName;
constraintMatchTotalMap.put(constraintId,
new ConstraintMatchTotal(constraintPackage, constraintName, constraintWeight, zeroScore));
}
}
代码示例来源:origin: kiegroup/optaplanner
protected Rule mockRule(String ruleName) {
Rule rule = mock(Rule.class);
when(rule.getPackageName()).thenReturn(getClass().getPackage().getName());
when(rule.getName()).thenReturn(ruleName);
return rule;
}
内容来源于网络,如有侵权,请联系作者删除!