[rules-users] Working on the complete solution set on Drools Planner

Geoffrey De Smet ge0ffrey.spam at gmail.com
Fri Mar 8 02:57:37 EST 2013


Op 08-03-13 08:22, lbrito schreef:
> Hi,
>
> I am thinking about using Drools Planner for an internal project related to
> order scheduling. It would in essence be a jobshop where we have 3 main
> machines which are always followed on the same specific order (and we have
> release dates for each task).
>
> I thought about a solution that would shuffle the job sequences on each
> machine looking for the best combination. However, the problem is that when
> applying the rules on the drl to the score calculation I would need to
> "pre-process" the solution in order to determine start-dates and end-dates
> for all tasks/jobs.
> Is there a way to access the complete solution from the drl, mash-up the
> information and use it in the score calculation?
The DroolsScoreDirector (= the class that manages the score calculation 
based on DRL's)
doesn't provide the Solution instance itself to the drl normally.
Although you could implement your Solution.getProblemFacts() to include 
the Solution instance too.
Either way, since all your ProblemFacts are available in the working 
memory of the DRL, you could create a high salience rule which does 
something like this:
rule myInitRule
salience 1000
when
    $s : Solution()
    $e : PlanningEntity()
then
   modify ($e) {
     $e.setSomeProperty($s.calculateSomePropertyFor($e));
   }
end

But you're probably much better off using an insertLogical(new 
SomePropertyForValueEntity()...)),
as the nurseRosteringScoreRules.drl do a lot.


Or, you could also look into the java ScoreDirector's (see manual), 
which give you total freedom at a very high maintenance cost (because 
you have to write the incremental score calculation delta algorithms 
yourself).

>
> Kind Regards,
> Luis
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Working-on-the-complete-solution-set-on-Drools-Planner-tp4022739.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>




More information about the rules-users mailing list