[rules-users] Best Solution found but latest solution does not work

moltenice dabrainstabber at gmail.com
Mon Mar 3 19:30:54 EST 2014


Hi Ge0ffrey, thanks for your quick reply.

Actually I'm quite sure it's my code, I just used brute force to enable
completeness on my small problem. I've attached my problem this time just
using a first fit heuristic.

If you run my code you will see that the solver hits a 0hard/0soft score
which is valid, but since it searches for better solutions afterwards it
seems to replace the best solution with the last solution it received.

I think the TimetableSlot objects' Lecturer planning variable is modified
when planner is running and since a new instance isn't made of the objects
they are just replaced by the latest value (and I'm guessing wherever the
best solution is stored its instances are replaced too since they refer to
the same point in memory). I feel I haven't implemented the
Solution/Planning Entities and variables correctly so do take a look at
those.

I think the best way to understand the problem is to just run the main
method. It should work out of the box as long as libraries are included!

Thanks a lot and awaiting your reply.

Karan

Timetabler.zip
<http://drools.46999.n3.nabble.com/file/n4028475/Timetabler.zip>  



--
View this message in context: http://drools.46999.n3.nabble.com/Best-Solution-found-but-latest-solution-does-not-work-tp4028442p4028475.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list