[rules-users] Drools rule [Planner]

André Fróes arfmoraes at gmail.com
Tue Jan 29 14:08:42 EST 2013


Is there a way to debug my project monitoring if it passes by my rule?
In my console i don't see the score of hard constraint of this rule:

----
rule "requiredWorktimeToFinish"
when
$engineer : Engineer($worktime : worktime)
$requiredWorktimeTotal : Number(intValue < $worktime) from accumulate(
WorkOrder (
engineer == $engineer,
$requiredWorktime : requiredWorktime),
sum($requiredWorktime)
)
then
insertLogical(new IntConstraintOccurrence("requiredWorktimeToFinish",
ConstraintType.NEGATIVE_HARD,
$requiredWorktimeTotal.intValue() - $worktime,
$engineer));
end

rule "hardConstraintsBroken"
        salience -1
    when
        $hardTotal : Number() from accumulate(
            IntConstraintOccurrence(constraintType ==
ConstraintType.NEGATIVE_HARD, $weight : weight),
            sum($weight)
        )
    then
        scoreHolder.setHardConstraintsBroken($hardTotal.intValue());
end
----



in my console it points no score
----
17:02:49.009 [main] INFO  o.d.p.core.solver.DefaultSolver - Solving
started: time spend (127), score (null), new best score (null), random seed
(0).
17:02:49.041 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (0), time spend (164), score (0hard/0soft), initialized planning
entity ([WorkOrder-7]).
17:02:49.042 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (1), time spend (165), score (0hard/0soft), initialized planning
entity ([WorkOrder-9]).
17:02:49.043 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (2), time spend (166), score (0hard/0soft), initialized planning
entity ([WorkOrder-8]).
17:02:49.045 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (3), time spend (168), score (0hard/0soft), initialized planning
entity ([WorkOrder-6]).
17:02:49.045 [main] INFO  o.d.p.c.c.g.DefaultGreedyFitSolverPhase - Phase
constructionHeuristic ended: step total (4), time spend (168), best score
(0hard/0soft).
17:02:49.274 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (0), time spend (397), score (0hard/0soft),     best score
(0hard/0soft), accepted/selected move count (1000/1000) for picked step
([WorkOrder-7] => [Engineer-5]).
17:02:49.592 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (1), time spend (715), score (0hard/0soft),     best score
(0hard/0soft), accepted/selected move count (1000/1926) for picked step
([WorkOrder-8] => [Engineer-3]).
17:02:50.045 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (2), time spend (1168), score (0hard/0soft),     best score
(0hard/0soft), accepted/selected move count (1000/3686) for picked step
([WorkOrder-6] => [Engineer-2]).
17:02:50.464 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (3), time spend (1587), score (0hard/0soft),     best score
(0hard/0soft), accepted/selected move count (1000/7516) for picked step
([WorkOrder-9] => [Engineer-2]).
17:02:53.877 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (4), time spend (5000), score (0hard/0soft),     best score
(0hard/0soft), accepted/selected move count (0/350227) for picked step
([WorkOrder-7] => [Engineer-4]).
17:02:53.877 [main] INFO  o.d.p.c.l.DefaultLocalSearchSolverPhase - Phase
localSearch ended: step total (5), time spend (5000), best score
(0hard/0soft).
17:02:53.878 [main] INFO  o.d.p.core.solver.DefaultSolver - Solving ended:
time spend (5000), best score (0hard/0soft), average calculate count per
second (72872).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130129/560d3dcb/attachment.html 


More information about the rules-users mailing list