XOR Rules
by Bojan Janisch
Hello everybody,
is there a way to XOR two rules? So if one condition is passed,
that not a specific other rule fires, even if that condition
also passed.
Thanks in advance.
Bojan
13 years, 2 months
Still stuck on simple test case
by Michiel Vermandel
Hi,
I'm still (or again) stuck on an easy test case.
A few days ago I first mentioned I had I very easy unit test that easily could be solved on sight but which was not solved optimal by planner.
Geoffrey pointed out that I needed to adjust the value of entityTabuSize in my localSearch acceptor configuration.
I did so (reducing from 7 to 3) and it worked, but now, having fiddled a bit on one of my rules I'm stuck again on the same issue.
I created a custom solver phase to force a specific solution and when adding this phase into my configuration I get a zero-score solution, namely the solution I forced.
So it does not seem to be an issue in my rules.
As suggested before by Geoffrey, I have put the logging level to debug and I get a lot of output like this (see beneath), but I don't really know how this can help me in solving the issue:
(I left out a lot of lines, I hope I left in the important ones)
INFO : [2013-01-16 09:34:29,847] Solving started: time spend (90), score (null), new best score (null), random seed (0).
DEBUG: [2013-01-16 09:34:30,113] Step index (0), time spend (357), score (-80hard/0soft), initialized planning entity (Inspection of PG_Leuven.I#0 2137587059).
DEBUG: [2013-01-16 09:34:30,248] Step index (1), time spend (492), score (-81hard/0soft), initialized planning entity (Inspection of PG_Haacht.I#0 1475783831).
DEBUG: [2013-01-16 09:34:30,268] Step index (2), time spend (512), score (-81hard/0soft), initialized planning entity (Inspection of PG_Leuven.I#2 2137587061).
DEBUG: [2013-01-16 09:34:30,295] Step index (3), time spend (539), score (-81hard/0soft), initialized planning entity (Inspection of Rotselaar.I#0 -105164233).
DEBUG: [2013-01-16 09:34:30,405] Step index (4), time spend (649), score (-161hard/0soft), initialized planning entity (Inspection of Rotselaar.I#1 -105164232).
DEBUG: [2013-01-16 09:34:30,490] Step index (5), time spend (734), score (-242hard/0soft), initialized planning entity (Inspection of PG_Haacht.I#1 1475783832).
DEBUG: [2013-01-16 09:34:30,572] Step index (6), time spend (816), score (-392hard/0soft), initialized planning entity (Inspection of PG_Leuven.I#1 2137587060).
INFO : [2013-01-16 09:34:30,572] Phase constructionHeuristic ended: step total (7), time spend (816), best score (-392hard/0soft).
DEBUG: [2013-01-16 09:34:31,499] Step index (0), time spend (1743), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1000) for picked step (Inspection of PG_Leuven.I#1 2137587060 => (P8) ).
DEBUG: [2013-01-16 09:34:32,037] Step index (1), time spend (2281), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1215) for picked step (Inspection of PG_Haacht.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:34:32,635] Step index (2), time spend (2879), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1587) for picked step (Inspection of Rotselaar.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:34:32,914] Step index (3), time spend (3158), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2118) for picked step (Inspection of PG_Haacht.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:34:33,128] Step index (4), time spend (3372), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2039) for picked step (Inspection of PG_Leuven.I#1 2137587060 => (P2) ).
...
DEBUG: [2013-01-16 09:34:41,219] Step index (68), time spend (11463), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1995) for picked step (Inspection of PG_Haacht.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:34:41,340] Step index (69), time spend (11584), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2070) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:34:41,460] Step index (70), time spend (11704), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2034) for picked step (Inspection of PG_Leuven.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:34:41,575] Step index (71), time spend (11819), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/1978) for picked step (Inspection of PG_Haacht.I#1 1475783832 => (P4) ).
DEBUG: [2013-01-16 09:34:41,693] Step index (72), time spend (11937), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2045) for picked step (Inspection of Rotselaar.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:34:41,813] Step index (73), time spend (12057), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (1000/2052) for picked step (Inspection of Rotselaar.I#1 -105164232 <=> Inspection of PG_Leuven.I#1 2137587060).
DEBUG: [2013-01-16 09:34:41,970] Step index (74), time spend (12214), score (-312hard/0soft), new best score (-312hard/0soft), accepted/selected move count (1000/2673) for picked step (Inspection of Rotselaar.I#1 -105164232 => Jesse).
DEBUG: [2013-01-16 09:34:42,089] Step index (75), time spend (12333), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2039) for picked step (Inspection of PG_Haacht.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:34:42,223] Step index (76), time spend (12467), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/1997) for picked step (Inspection of PG_Leuven.I#2 2137587061 => TL).
DEBUG: [2013-01-16 09:34:42,346] Step index (77), time spend (12590), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2073) for picked step (Inspection of PG_Haacht.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:34:42,484] Step index (78), time spend (12728), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2093) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:34:42,607] Step index (79), time spend (12851), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2049) for picked step (Inspection of PG_Haacht.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:34:42,720] Step index (80), time spend (12964), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/1977) for picked step (Inspection of PG_Leuven.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:34:42,836] Step index (81), time spend (13080), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/1991) for picked step (Inspection of PG_Haacht.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:34:42,959] Step index (82), time spend (13203), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (1000/2012) for picked step (Inspection of Rotselaar.I#0 -105164233 => (P3) ).
DEBUG: [2013-01-16 09:34:43,078] Step index (83), time spend (13322), score (-162hard/0soft), new best score (-162hard/0soft), accepted/selected move count (1000/2028) for picked step (Inspection of Rotselaar.I#1 -105164232 => (P3) ).
DEBUG: [2013-01-16 09:34:43,195] Step index (84), time spend (13439), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2013) for picked step (Inspection of PG_Leuven.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:34:43,313] Step index (85), time spend (13557), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2086) for picked step (Inspection of PG_Leuven.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:34:43,424] Step index (86), time spend (13668), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2011) for picked step (Inspection of PG_Haacht.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:34:43,540] Step index (87), time spend (13784), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2017) for picked step (Inspection of PG_Haacht.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:34:43,663] Step index (88), time spend (13907), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2090) for picked step (Inspection of Rotselaar.I#1 -105164232 => TL).
...
DEBUG: [2013-01-16 09:36:04,828] Step index (468), time spend (58711), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2071) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:36:04,949] Step index (469), time spend (58832), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2134) for picked step (Inspection of PG_Leuven.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:36:05,066] Step index (470), time spend (58949), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2073) for picked step (Inspection of Rotselaar.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:36:05,183] Step index (471), time spend (59066), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2067) for picked step (Inspection of Rotselaar.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:36:05,296] Step index (472), time spend (59179), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2034) for picked step (Inspection of PG_Haacht.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:36:05,409] Step index (473), time spend (59292), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2025) for picked step (Inspection of PG_Leuven.I#2 2137587061 => IV).
DEBUG: [2013-01-16 09:36:05,519] Step index (474), time spend (59402), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/1972) for picked step (Inspection of PG_Haacht.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:36:05,634] Step index (475), time spend (59517), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2028) for picked step (Inspection of PG_Leuven.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:36:05,749] Step index (476), time spend (59632), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2078) for picked step (Inspection of Rotselaar.I#0 -105164233 => IV).
DEBUG: [2013-01-16 09:36:05,863] Step index (477), time spend (59746), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2042) for picked step (Inspection of Rotselaar.I#1 -105164232 => IV).
DEBUG: [2013-01-16 09:36:05,980] Step index (478), time spend (59863), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2072) for picked step (Inspection of PG_Haacht.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:36:06,095] Step index (479), time spend (59978), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (1000/2037) for picked step (Inspection of PG_Leuven.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:36:06,118] Step index (480), time spend (60001), score (-162hard/0soft), best score (-162hard/0soft), accepted/selected move count (171/360) for picked step (Inspection of PG_Leuven.I#0 2137587059 => IV).
INFO : [2013-01-16 09:36:06,118] Phase localSearch ended: step total (481), time spend (60001), best score (-162hard/0soft).
INFO : [2013-01-16 09:36:06,118] Solving ended: time spend (60001), best score (-162hard/0soft), average calculate count per second (32639).
isEveryProblemFactChangeProcessed: true
isTerminateEarly: false
My configuration:
<localSearch>
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<maximumSecondsSpend>3600</maximumSecondsSpend>
<scoreAttained>0hard/0soft</scoreAttained>
</termination>
<unionMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>period</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>inspector</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>type</planningVariableName>
</valueSelector>
</changeMoveSelector>
<swapMoveSelector>
</swapMoveSelector>
</unionMoveSelector>
<acceptor>
<planningEntityTabuSize>3</planningEntityTabuSize>
</acceptor>
<forager>
<minimalAcceptedSelection>1000</minimalAcceptedSelection>
</forager>
</localSearch>
I also tried with a different localSearch configuration:
<localSearch>
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<maximumSecondsSpend>3600</maximumSecondsSpend>
<scoreAttained>0hard/0soft</scoreAttained>
</termination>
<unionMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>period</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>inspector</planningVariableName>
</valueSelector>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector>
<planningVariableName>type</planningVariableName>
</valueSelector>
</changeMoveSelector>
<swapMoveSelector>
</swapMoveSelector>
</unionMoveSelector>
<acceptor>
<simulatedAnnealingStartingTemperature>2hard/100soft</simulatedAnnealingStartingTemperature>
<planningEntityTabuSize>3</planningEntityTabuSize>
</acceptor>
<forager>
<minimalAcceptedSelection>4</minimalAcceptedSelection>
</forager>
</localSearch>
Result:
INFO : [2013-01-16 09:12:43,653] Solving started: time spend (87), score (null), new best score (null), random seed (0).
DEBUG: [2013-01-16 09:12:43,917] Step index (0), time spend (352), score (-80hard/0soft), initialized planning entity (Inspection of B747-AX1.I#0 2137587059).
DEBUG: [2013-01-16 09:12:44,039] Step index (1), time spend (474), score (-81hard/0soft), initialized planning entity (Inspection of B737-DX7.I#0 1475783831).
DEBUG: [2013-01-16 09:12:44,060] Step index (2), time spend (495), score (-81hard/0soft), initialized planning entity (Inspection of B747-AX1.I#2 2137587061).
DEBUG: [2013-01-16 09:12:44,088] Step index (3), time spend (523), score (-81hard/0soft), initialized planning entity (Inspection of B737-DC3.I#0 -105164233).
DEBUG: [2013-01-16 09:12:44,176] Step index (4), time spend (611), score (-161hard/0soft), initialized planning entity (Inspection of B737-DC3.I#1 -105164232).
DEBUG: [2013-01-16 09:12:44,270] Step index (5), time spend (705), score (-242hard/0soft), initialized planning entity (Inspection of B737-DX7.I#1 1475783832).
DEBUG: [2013-01-16 09:12:44,380] Step index (6), time spend (815), score (-392hard/0soft), initialized planning entity (Inspection of B747-AX1.I#1 2137587060).
INFO : [2013-01-16 09:12:44,380] Phase constructionHeuristic ended: step total (7), time spend (815), best score (-392hard/0soft).
DEBUG: [2013-01-16 09:12:44,420] Step index (0), time spend (855), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/19) for picked step (Inspection of B747-AX1.I#2 2137587061 => TL).
DEBUG: [2013-01-16 09:12:44,444] Step index (1), time spend (879), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DC3.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:12:44,465] Step index (2), time spend (900), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/23) for picked step (Inspection of B747-AX1.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:12:44,488] Step index (3), time spend (923), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/23) for picked step (Inspection of B737-DC3.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:12:44,529] Step index (4), time spend (964), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/21) for picked step (Inspection of B747-AX1.I#1 2137587060 => TL).
...
DEBUG: [2013-01-16 09:12:44,776] Step index (12), time spend (1211), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/13) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:12:44,814] Step index (13), time spend (1249), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/45) for picked step (Inspection of B737-DX7.I#1 1475783832 => (P4) ).
DEBUG: [2013-01-16 09:12:44,849] Step index (14), time spend (1284), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/46) for picked step (Inspection of B747-AX1.I#2 2137587061 => IV).
DEBUG: [2013-01-16 09:12:44,880] Step index (15), time spend (1315), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/39) for picked step (Inspection of B747-AX1.I#0 2137587059 => TL).
...
DEBUG: [2013-01-16 09:12:47,043] Step index (122), time spend (3478), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/40) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:12:47,046] Step index (123), time spend (3481), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/20) for picked step (Inspection of B747-AX1.I#0 2137587059 => TL).
DEBUG: [2013-01-16 09:12:47,049] Step index (124), time spend (3484), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/16) for picked step (Inspection of B737-DC3.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:12:47,056] Step index (125), time spend (3491), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/46) for picked step (Inspection of B737-DC3.I#1 -105164232 <=> Inspection of B747-AX1.I#1 2137587060).
DEBUG: [2013-01-16 09:12:47,062] Step index (126), time spend (3497), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/44) for picked step (Inspection of B737-DX7.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:12:47,067] Step index (127), time spend (3502), score (-392hard/0soft), best score (-392hard/0soft), accepted/selected move count (4/26) for picked step (Inspection of B747-AX1.I#2 2137587061 => TL).
DEBUG: [2013-01-16 09:12:47,072] Step index (128), time spend (3507), score (-312hard/0soft), new best score (-312hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DC3.I#1 -105164232 => Jesse).
DEBUG: [2013-01-16 09:12:47,078] Step index (129), time spend (3513), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/37) for picked step (Inspection of B747-AX1.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:12:47,080] Step index (130), time spend (3515), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/16) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
...
DEBUG: [2013-01-16 09:12:47,131] Step index (137), time spend (3566), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/28) for picked step (Inspection of B747-AX1.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:12:47,135] Step index (138), time spend (3570), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/16) for picked step (Inspection of B747-AX1.I#2 2137587061 <=> Inspection of B737-DC3.I#1 -105164232).
DEBUG: [2013-01-16 09:12:47,142] Step index (139), time spend (3577), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/69) for picked step (Inspection of B737-DX7.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:12:47,148] Step index (140), time spend (3583), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/39) for picked step (Inspection of B737-DC3.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:12:47,151] Step index (141), time spend (3586), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/22) for picked step (Inspection of B747-AX1.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:12:47,153] Step index (142), time spend (3588), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/9) for picked step (Inspection of B747-AX1.I#2 2137587061 <=> Inspection of B737-DC3.I#1 -105164232).
DEBUG: [2013-01-16 09:12:47,160] Step index (143), time spend (3595), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/51) for picked step (Inspection of B737-DX7.I#1 1475783832 => IV).
DEBUG: [2013-01-16 09:12:47,167] Step index (144), time spend (3602), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/50) for picked step (Inspection of B747-AX1.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:12:47,172] Step index (145), time spend (3607), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/37) for picked step (Inspection of B737-DC3.I#0 -105164233 => IV).
...
DEBUG: [2013-01-16 09:12:47,824] Step index (259), time spend (4259), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DC3.I#0 -105164233 => IV).
DEBUG: [2013-01-16 09:12:47,827] Step index (260), time spend (4262), score (-312hard/0soft), best score (-312hard/0soft), accepted/selected move count (4/30) for picked step (Inspection of B737-DC3.I#1 -105164232 <=> Inspection of B747-AX1.I#2 2137587061).
DEBUG: [2013-01-16 09:12:47,835] Step index (261), time spend (4270), score (-242hard/0soft), new best score (-242hard/0soft), accepted/selected move count (4/50) for picked step (Inspection of B737-DC3.I#0 -105164233 => (P8) ).
DEBUG: [2013-01-16 09:12:47,838] Step index (262), time spend (4273), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/27) for picked step (Inspection of B737-DX7.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:12:47,842] Step index (263), time spend (4277), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/32) for picked step (Inspection of B737-DX7.I#0 1475783831 => TL).
DEBUG: [2013-01-16 09:12:47,846] Step index (264), time spend (4281), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/26) for picked step (Inspection of B747-AX1.I#1 2137587060 => TL).
...
DEBUG: [2013-01-16 09:27:17,903] Step index (16715), time spend (59977), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/49) for picked step (Inspection of B737-DX7.I#0 -105164233 => TL).
DEBUG: [2013-01-16 09:27:17,905] Step index (16716), time spend (59979), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/19) for picked step (Inspection of B737-DC3.I#1 2137587060 => TL).
DEBUG: [2013-01-16 09:27:17,908] Step index (16717), time spend (59982), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/43) for picked step (Inspection of B737-DX7.I#1 -105164232 => TL).
DEBUG: [2013-01-16 09:27:17,912] Step index (16718), time spend (59986), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/55) for picked step (Inspection of B747-AX1.I#1 1475783832 => TL).
DEBUG: [2013-01-16 09:27:17,915] Step index (16719), time spend (59989), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/41) for picked step (Inspection of B737-DC3.I#0 2137587059 => IV).
DEBUG: [2013-01-16 09:27:17,918] Step index (16720), time spend (59992), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/47) for picked step (Inspection of B737-DC3.I#1 2137587060 => IV).
DEBUG: [2013-01-16 09:27:17,922] Step index (16721), time spend (59996), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/62) for picked step (Inspection of B747-AX1.I#0 1475783831 => IV).
DEBUG: [2013-01-16 09:27:17,924] Step index (16722), time spend (59998), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/24) for picked step (Inspection of B737-DX7.I#1 -105164232 => IV).
DEBUG: [2013-01-16 09:27:17,926] Step index (16723), time spend (60000), score (-242hard/0soft), best score (-242hard/0soft), accepted/selected move count (4/25) for picked step (Inspection of B747-AX1.I#1 1475783832 => IV).
INFO : [2013-01-16 09:27:17,926] Phase localSearch ended: step total (16724), time spend (60000), best score (-242hard/0soft).
INFO : [2013-01-16 09:27:17,926] Solving ended: time spend (60000), best score (-242hard/0soft), average calculate count per second (22637).
isEveryProblemFactChangeProcessed: true
isTerminateEarly: false
Any ideas on how to move forward from here?
Thanks,
Michiel Vermandel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
13 years, 2 months
Dates in an XLS decision table
by tad628
I'm new to Drools and trying to figure out how to build a condition around a
date. Using DRL, it might look something like this:
rule "Simple percentage with incentive date X"
when
$i : LineItem( status == LineItem.PROCESSING, $amount : amount,
$orderDate : orderDate )
then
Date $incentiveDate = new GregorianCalendar(2012, 0, 1).getTime();
Date $incentiveDate2 = new GregorianCalendar(2013, 0, 1).getTime();
if ( $orderDate.before( $incentiveDate ) )
....
else if ( $orderDate.before( $incentiveDate2 ) )
...etc.
I can't figure out how to do this in a spreadsheet, however. For the
condition I have the two lines below the "CONDITION" cell as:
LineItem
orderDate.before( $param )
with the various dates as rows down in the data section.
When I run this, I get an exception of that "unable to resolve method using
strict-mode: java.util.Date.before(java.lang.Double)"
How do I specify dates in the data field to get around this?
--
View this message in context: http://drools.46999.n3.nabble.com/Dates-in-an-XLS-decision-table-tp402154...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
The constructor is not visible
by suddeb
Hi,
I am trying to create a rule:
//list any import classes here.
*import com.sudipta.sample.Student;
import com.sudipta.sample.PassType;
rule "If Student's age is less than 19"
when
$student : Student(age<19)
then
System.out.println("Child Pass for "+$student.getName());
System.out.println("Creating PassType Object..");
insert(new PassType($student,"Child"));
end*
I am getting the error:
The constructor PassType(String) is not visible
Whereas in the PassType class, the constructor is defined like:
*public class PassType {
private Student student;
private String type;
PassType(Student student, String type){
this.student = student;
this.type = type;
}
......
}*
Can anyone please help me why this error is coming? Thanks.
Regards,
Sudipta
--
View this message in context: http://drools.46999.n3.nabble.com/The-constructor-is-not-visible-tp402162...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
[BAD Bug]: Re: Drools Expert does not sort integers correctly
by Wolfgang Laun
This BAD bug was introduced on the way from 5.4.0 to 5.5.0 (and seems
to have sneaked into 6.0.0 as well).
Only 5.4.0 and predecessors work as expected.
Damage control? How far can 5.5.0 be trusted?
On 17/01/2013, John Smith <ffirstt.llastt(a)gmail.com> wrote:
> I am new to Drools and am trying to get the sample program to work. This
> sample is given in the drools documentation
> http://docs.jboss.org/drools/release/5.5.0.Final/drools-expert-docs/html_....
> This drool rule is expected to sort integers. I just changed the numbers
> from what are given in the sample and they do not get sorted as expected.
> Tried using drools version 5.5.0, 5.5.1 and the master 6.0.0, but got the
> same wrong results.
>
> Following is the main code:
> package com.sample;
>
> public class Example2 {
> public static void main(String[] args) throws Exception {
> Number[] numbers = new Number[] { wrap(5), wrap(6), wrap(4),
> wrap(1), wrap(2) };
> new RuleRunner().runRules(new String[] { "Example3.drl" },
> numbers);
> }
>
> private static Integer wrap(int i) {
> return new Integer(i);
> }
> }
>
> The RuleRunner class is the same as given in the example and I do not
> think
> I should give that here, since it will clutter the question. It simply
> creates the KnowledgeBase, stateful session, inserts the facts as given in
> the 'numbers' array above and then calls fireAllRules method on the
> session.
>
> The rule file (Example3.drl) is:
>
>
> rule "Rule 04"
> dialect "mvel"
> when
> $number : Number()
> not Number(intValue < $number.intValue)
> then
> System.out.println("Number found with value: " + $number.intValue());
> retract($number);
> end
>
>
> The output I get is as follows:
> Loading file: Example3.drl
> Inserting fact: 5
> Inserting fact: 6
> Inserting fact: 4
> Inserting fact: 1
> Inserting fact: 2
> Number found with value: 1
> Number found with value: 4
> Number found with value: 2
> Number found with value: 5
> Number found with value: 6
>
> Not the correct expected ascending sorted order.
>
> What might I be doing wrong? I cannot imagine that the drools rule engine
> would be broken at this basic level.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Drools-Expert-does-not-sort-integers-co...
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
13 years, 2 months
Unable to modify collection fields in Guvnor Test Scenarios
by dmoreno
I have imported a POJO model jar in Guvnor. The jar is made up of typical
data transfer objects, with properties accessible through getters and/or
setters.
Some of those properties are collections, only accessible through getters,
and therefore, they can only be modified through the usual collection
methods: add, remove, and so on.
Then I have created some business rules using facts from the imported model.
What I haven't found is a way to set up such collection fields in the Given
section of a Test Scenario. Trying to assign a literal value gives the
error:
"Unable to run the scenario.
[Error: could not access/write property …]"
Does anyone know any way to achieve that goal? Bear in mind that I don't
have access to the POJO model source code.
Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-modify-collection-fields-in-G...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
wierd error : illegal bytecode sequence - method not verified
by arrehman
Hi,
I have been using Drools 5.3.0 core successfully in my grails/groovy/java
project. The two dependency that are mentioned in my buildconfig file
(BuildConfig.groovy) is :
//drools
runtime 'org.drools:drools-core:5.3.0.Final'
runtime 'org.drools:drools-compiler:5.3.0.Final'
runtime 'com.sun.xml.bind:jaxb-xjc:2.2.4'
Now I wanted to switch to Drools 5.5.0. What I did is I merely changed the
version number above.
//drools
runtime 'org.drools:drools-core:5.5.0.Final'
runtime 'org.drools:drools-compiler:5.5.0.Final'
runtime 'com.sun.xml.bind:jaxb-xjc:2.2.4'
However the tests that were working before are failing now, with some weird
error. I am guessing this has to do with conflicting jars or missing jars or
whatever and not drools.
=============== DEBUG MESSAGE: illegal bytecode sequence - method not
verified ================
Jan 17 2013 14:19:57 ERROR business.service.RulesService - Error executing
validation drools rules Exception executing consequence for rule "Sale Price
Not <= 20 " in business.rules: java.lang.NullPointerException
Jan 17 2013 14:19:57 ERROR business.service.AddsService - Error executing
validation drools rules Exception executing consequence
Any idea what is going on?
Thanks,
Arrehman
--
View this message in context: http://drools.46999.n3.nabble.com/wierd-error-illegal-bytecode-sequence-m...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months
unable to import rules into guvnor
by kurrent93
HI
Im trying to import rules and assets into a new gunvor installation, but I
am getting the following error.
Can anyone advise on how I can fix this issue?
ERROR 16-01 23:39:01,398
(RulesRepository.java:importRulesRepositoryFromStream:1
326) XML parse error
javax.jcr.InvalidSerializedDataException: XML parse error
at
org.apache.jackrabbit.commons.AbstractWorkspace.importXML(AbstractWor
kspace.java:62)
at
org.drools.repository.RulesRepository.importRulesRepositoryFromStream
(RulesRepository.java:1312)
at
org.drools.repository.RulesRepository$Proxy$_$$_WeldClientProxy.impor
tRulesRepositoryFromStream(RulesRepository$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.files.FileManagerService.importRulesReposito
ry(FileManagerService.java:270)
at
org.drools.guvnor.server.files.FileManagerService$Proxy$_$$_WeldClien
tProxy.importRulesRepository(FileManagerService$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.processImportR
epository(RepositoryBackupServlet.java:203)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.access$300(Rep
ositoryBackupServlet.java:42)
at
org.drools.guvnor.server.files.RepositoryBackupServlet$1.execute(Repo
sitoryBackupServlet.java:104)
at
org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(R
epositoryServlet.java:59)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.doPost(Reposit
oryBackupServlet.java:72)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1;
Conten
t is not allowed in prolog.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:198)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:177)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:441)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:368)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1375)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(XMLDocumentScannerImpl.java:996)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:607)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(XMLNSDocumentScannerImpl.java:116)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:835)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:123)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1210)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:568)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParser
Impl.java:302)
at
org.apache.jackrabbit.commons.xml.ParsingContentHandler.parse(Parsing
ContentHandler.java:62)
at
org.apache.jackrabbit.commons.AbstractWorkspace.importXML(AbstractWor
kspace.java:54)
... 23 more
ERROR 16-01 23:39:01,405 (RepositoryServlet.java:doAuthorizedAction:61)
Repository error when importing from stream.
org.drools.repository.RulesRepositoryException: Repository error when
importing
from stream.
at
org.drools.repository.RulesRepository.importRulesRepositoryFromStream
(RulesRepository.java:1328)
at
org.drools.repository.RulesRepository$Proxy$_$$_WeldClientProxy.impor
tRulesRepositoryFromStream(RulesRepository$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.files.FileManagerService.importRulesReposito
ry(FileManagerService.java:270)
at
org.drools.guvnor.server.files.FileManagerService$Proxy$_$$_WeldClien
tProxy.importRulesRepository(FileManagerService$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.processImportR
epository(RepositoryBackupServlet.java:203)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.access$300(Rep
ositoryBackupServlet.java:42)
at
org.drools.guvnor.server.files.RepositoryBackupServlet$1.execute(Repo
sitoryBackupServlet.java:104)
at
org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(R
epositoryServlet.java:59)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.doPost(Reposit
oryBackupServlet.java:72)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:293)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:602)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.jcr.InvalidSerializedDataException: XML parse error
at
org.apache.jackrabbit.commons.AbstractWorkspace.importXML(AbstractWor
kspace.java:62)
at
org.drools.repository.RulesRepository.importRulesRepositoryFromStream
(RulesRepository.java:1312)
... 22 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1;
Conten
t is not allowed in prolog.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAX
ParseException(ErrorHandlerWrapper.java:198)
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErro
r(ErrorHandlerWrapper.java:177)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:441)
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(
XMLErrorReporter.java:368)
at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(X
MLScanner.java:1375)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$Prolog
Driver.next(XMLDocumentScannerImpl.java:996)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:607)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
(XMLNSDocumentScannerImpl.java:116)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:835)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:764)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:123)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1210)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:568)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParser
Impl.java:302)
at
org.apache.jackrabbit.commons.xml.ParsingContentHandler.parse(Parsing
ContentHandler.java:62)
at
org.apache.jackrabbit.commons.AbstractWorkspace.importXML(AbstractWor
kspace.java:54)
... 23 more
--
View this message in context: http://drools.46999.n3.nabble.com/unable-to-import-rules-into-guvnor-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 2 months