Re: [rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move

2011-11-15 Thread npiedeloup
If someone got the same problem : I think i've found my problem.

As i write it my undoMove was : (*new PlanMove(assigment, fromDay)*)

Read : my fromDay was set in constructor and then it was set to the initial
day.
During solving assigments are plan on other days, but the undoMove always
return to initial state. 

Example :
Assigment1 is create at the DayFutur
At init phase i create a cached move :
Assigment1(DayFutur) to Day1
and i set the fromDay to DayFutur

Then at runtime every times i do this move i create a undoMove :
Assigment1 to DayFutur
whatever the true old day was.



Thanks for your help
Best regards,


--
View this message in context: 
http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corrupted-undo-move-tp3495070p3511194.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move

2011-11-14 Thread npiedeloup
I have test in TRACE mode, and I don't know what I can do with this error.
In this test I have activated some Constraints.

I've got a The presumedScore (0hard/-500soft) is corrupted because it is
not the realScore  (0hard/-450soft)

I've got some questions :
- When this error was launch ? 
- In Move classes could I use the same PlanningEntity instance in the move
itself and his undomove ? or should i clone it ? 
- Are the causes of IntConstraintOccurrence important for delta score
computing ?


I will try to get the simpliest test case of this problem, to test it
deeper.

Regards,

--
View this message in context: 
http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corrupted-undo-move-tp3495070p3506686.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move

2011-11-10 Thread npiedeloup
Thanks for your response.

I'have juste test you proposition of method on assigment, and i've got the
same error.
I also test with a simplier rule set :

Juste 1 rule : (and the two for scoreCalculator of course)
rule notPlannified 
 when 
$assigment: Assigment()
then
insertLogical(new IntConstraintOccurrence(notPlannified,
ConstraintType.NEGATIVE_SOFT, 50, $assigment));

I desactivate the solverScope.calculateScoreFromWorkingMemory(); call in UI,
juste in case.

I check my cloneSolution : i juste clone the assigment object and copy the
score.
equals and hashcode are ok on assigment and move object.
No overrided equals and hashcode on other facts, but since i don't recreate
nor clone them, i think it's unnecessary. (In fact i don't really understand
where hashcode and equals was really necessary since the working memory keep
same instances).



--
View this message in context: 
http://drools.46999.n3.nabble.com/Planner-CachedMoveFactory-drive-to-Corrupted-undo-move-tp3495070p3496696.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] [Planner] CachedMoveFactory drive to Corrupted undo move

2011-11-09 Thread npiedeloup
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.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users