Hi,
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/Drools%20jBPM/view/...
=> "Computer says no" ;-)
I'm still running unit tests with very little entities / variables. That is then
probably the cause.
First I thought it was because I wrote my own move factory, but after reverting to the
default classes, it remained the same.
So, I do want to use a custom move factory; in that case would it be wise to change to
"Cached shuffled selection" (because all moves are already cached because of my
custom factory (without iterator - for the moment))?
Or would the benefit still be minimal?
Thanks
Michiel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at
http://twitter.com/#!/Codessentials
________________________________
From: Geoffrey De Smet <ge0ffrey.spam(a)gmail.com
To: Rules
Users List <rules-users(a)lists.jboss.org>
Sent: Friday, January 25, 2013 2:47 PM
Subject: Re: [rules-users] Planner: duplicate moves within a single step?
Op 25-01-13 14:26, Michiel Vermandel schreef:
Hi,
I noticed something really strange in my trace logging: certain moves are made multiple
times, even consecutive.
How is this possible?
I am using Planner 5.5.0.Final and no custom move
factories (see
config below).
TRACE: [2013-01-25 14:12:28,309] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (12), score (-515hard/0soft),
accepted (true) for move ({T= Inspect B747-AX1.I#1
[7->7] Jesse IV} => (P4) ).
TRACE: [2013-01-25 14:12:28,309] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Ignoring not doable move ({T= Inspect A380-TR1.I#0
[5->6] Kristof IV} => IV).
TRACE: [2013-01-25 14:12:28,310] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (14), score (-2090hard/0soft), accepted
(true) for move ({T= Inspect A380-TR1.I#1 [5->6] Gerald IV}
=> (P9) ).
TRACE: [2013-01-25 14:12:28,310] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Ignoring not doable move ({T= Inspect A320-CZ4.I#0
[7->9] Kristof IV} => IV).
TRACE: [2013-01-25 14:12:28,310] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Ignoring not doable move ({T= Inspect A380-TR1.I#1
[5->6] Gerald IV} => IV).
TRACE: [2013-01-25 14:12:28,311] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (17), score (-230hard/0soft), accepted
(true) for move ({T= Inspect B747-AX1.I#1 [7->7] Jesse IV}
=> Andy).
TRACE: [2013-01-25 14:12:28,312] main
org.drools.planner.core.localsearch.decider.DefaultDecider - Move index (18),
score (-120hard/0soft), accepted (true) for move ({T= Inspect B747-AX1.I#0 [5->5] Andy
IV} => (P7) ).
TRACE: [2013-01-25 14:12:28,313] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (19), score (-120hard/0soft),
accepted (true) for move ({T= Inspect B747-AX1.I#0
[5->5] Andy IV} => (P7) ).
"Just in time random selection" could explain this
behavior. Read this section:
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/Drools%20jBPM/view/...
"selectionOrder RANDOM (default): Select the selections (Moves, entities, values,
...) in non-shuffled random order. A selection might be selected multiple times. This
scales up well in performance because it does not require caching."
It's very unlikely that this happens, except for toy problems. How
many entities and variables does this dataset have?
Switch to "Cached shuffled selection" to avoid it. Read those docs
to understand the trade-off.
TRACE: [2013-01-25 14:12:28,313] main
org.drools.planner.core.localsearch.decider.DefaultDecider - Move index (20),
score (-30hard/0soft), accepted (true) for move ({T= Inspect B747-AX1.I#1 [7->7] Jesse
IV} => TL).
TRACE: [2013-01-25 14:12:28,315] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (21), score (-2180hard/0soft), accepted
(true) for move ({T= Inspect B747-AX1.I#0 [5->5] Andy IV}
=> (P1) ).
TRACE: [2013-01-25 14:12:28,316] main
org.drools.planner.core.localsearch.decider.DefaultDecider - Move index (22),
score (-515hard/0soft), accepted (true) for move ({T= Inspect B747-AX1.I#1 [7->7] Jesse
IV} => (P4) ).
TRACE: [2013-01-25 14:12:28,317] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (23), score (-515hard/0soft),
accepted (true) for move ({T= Inspect B747-AX1.I#1
[7->7] Jesse IV} => (P4) ).
TRACE: [2013-01-25 14:12:28,318] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (24), score (-3180hard/0soft), accepted
(true) for move ({T= Inspect A320-CZ4.I#1 [7->8] Andy IV}
=> (P1) ).
TRACE: [2013-01-25 14:12:28,318] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Ignoring not doable move ({T= Inspect B747-AX1.I#1
[7->7] Jesse IV} => IV).
TRACE: [2013-01-25 14:12:28,320] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (26), score (-120hard/0soft), accepted
(true) for move ({T= Inspect B747-AX1.I#1 [7->7] Jesse IV}
=> (P5) ).
TRACE: [2013-01-25 14:12:28,322] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (27), score (-45hard/0soft), accepted
(true) for move ({T= Inspect B747-AX1.I#1 [7->7] Jesse IV}
=> (P8) ).
TRACE: [2013-01-25 14:12:28,323] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (28), score (-30hard/0soft), accepted
(true) for move ({T= Inspect A380-TR1.I#0 [5->6] Kristof
IV} => TL).
TRACE: [2013-01-25 14:12:28,324] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (29), score (-2635hard/0soft), accepted
(true) for move ({T= Inspect A320-CZ4.I#1 [7->8] Andy IV}
=> (P2) ).
TRACE: [2013-01-25 14:12:28,325] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (30), score (-650hard/0soft), accepted
(true) for move ({T= Inspect A320-CZ4.I#0 [7->9] Kristof
IV} => (P6) ).
TRACE: [2013-01-25 14:12:28,334] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Ignoring not doable move ({T= Inspect A380-TR1.I#2
[5->6] Jesse IV} => Jesse).
TRACE: [2013-01-25 14:12:28,335] main
org.drools.planner.core.localsearch.decider.DefaultDecider
- Move index (32), score (-230hard/0soft), accepted
(true) for move ({T= Inspect B747-AX1.I#0 [5->5] Andy IV}
=> Gerald).
>TRACE: [2013-01-25 14:12:28,336] main
org.drools.planner.core.localsearch.decider.DefaultDecider - Move index (33),
score (-515hard/0soft), accepted (true) for move ({T= Inspect B747-AX1.I#1 [7->7] Jesse
IV} => (P4) ).
>
>
>Config:
><?xml version="1.0"
encoding="UTF-8"?
><solver
> <environmentMode>DEBUG</environmentMode
> <!-- Domain model
configuration --
<solutionClass>be.axi.planner.app.InspectionSchedule</solutionClass
<planningEntityClass>be.axi.planner.domain.Task</planningEntityClass
> <!-- Score configuration
--
> <scoreDirectorFactory
<scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType
>
<scoreDrl>/inspectionRules.drl</scoreDrl
>
</scoreDirectorFactory
>
> <constructionHeuristic
<constructionHeuristicType>BEST_FIT_DECREASING</constructionHeuristicType
<constructionHeuristicPickEarlyType>FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING</constructionHeuristicPickEarlyType
> </constructionHeuristic
>
> <!--customSolverPhase
>
<customSolverPhaseCommandClass>be.axi.planner.solution.SolutionInitializer</customSolverPhaseCommandClass
> </customSolverPhase--
>
> <localSearch
> <termination
<terminationCompositionStyle>OR</terminationCompositionStyle
<maximumSecondsSpend>3600</maximumSecondsSpend
<scoreAttained>0hard/0soft</scoreAttained
>
</termination
>
<unionMoveSelector
>
<changeMoveSelector
>
<valueSelector
>
<planningVariableName>type</planningVariableName
> </valueSelector
> </changeMoveSelector
> <changeMoveSelector
> <valueSelector
>
<planningVariableName>spector</planningVariableName
> </valueSelector
> </changeMoveSelector
> <changeMoveSelector
> <valueSelector
>
<planningVariableName>period</planningVariableName
> </valueSelector
> </changeMoveSelector
> </unionMoveSelector
> <acceptor
>
<planningEntityTabuSize>7</planningEntityTabuSize
> </acceptor
>
<forager
>
<minimalAcceptedSelection>1000</minimalAcceptedSelection
> </forager
>
</localSearch
></solver
>Thanks,
>Michiel
>-----------------
>http://www.codessentials.com - Your essential software, for free!
>Follow us at
http://twitter.com/#!/Codessentials
>_______________________________________________
rules-users mailing list rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users