[rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move
npiedeloup
npiedeloup at kleegroup.com
Wed Nov 9 17:31:36 EST 2011
Hello,
I'm almost new to Drools Planner, and i run into some problems.
One of them, I really want to understand is that my Planner works well until
i try to use a CachedMoveFactory instead of my MoveFactory, then i've got
"Corrupted undo move" at step 2.
Assigment are my PlanningEntity, Day are facts
My MoveFactory is like this :
for (final Assigment assigment: mySolution.getAllAssigments()) {
for (final Day day : mySolution.getAllDays()) {
moveList.add(new PlanMove(assigment, day));
}
}
And my doMove is like :
final FactHandle factHandle = workingMemory.getFactHandle(assigment);
assigment.setDay(toDay);
workingMemory.update(factHandle, assigment);
The UndoMove is really simple (new PlanMove(assigment, fromDay)) , so I
pretty sure this part is correct.
I have add a false day(future=true) which mean "not plannified yet" and all
assigment start at this day.
I have a rule like :
rule "notPlannified"
when
$assigment: Assigment( day.future )
then
insertLogical(new IntConstraintOccurrence("notPlannified",
ConstraintType.NEGATIVE_SOFT, 50, $assigment));
end
My logs show :
INFO Phase construction heuristic finished: step total (0), time spend
(255), best score (0hard/-18750soft).
DEBUG Step index (0), time spend (2175), score (0hard/-18700soft), new
best score (0hard/-18700soft), accepted move size (1000) for picked step
([A148@[UNAFFECT]] ==> [12/11]).
Someone can explain me what I miss ?
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corrupted-undo-move-tp3495070p3495070.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
More information about the rules-users
mailing list