Search code examples
javadroolsoptaplanner

Optaplanner+Drools - How can I Sequential Order


I have more tasks and resources so I want to order these with using optaplanner and drool but I couldn't find the correct Rule.

Design :

First Task has 3 steps
Second Task has 2 steps
And Has multiple Resources for use on every steps

Rules :

First Task's every steps has to Sequential order and use only 1 resource

Second Task's steps are can use more resource but it has to sequential order too

For Example: second step can't start before first step done.

==> Task A; Step1,Step2,Step3; --- Resource1 does first step1 second step2 third step3

==> Task B; Step1,Step2 ---- Resource2 does step1 and after its done Resource 3 does Step2 

My Theory :

If I can control every previous step when optaplanner core runs I can compare current task and previous task but I don't know how I can get previous task or if you can find better algorithm?


Solution

  • Your use case somehow similar to project job scheduling example from optaplanner.. Have you check it out?..

    1. Task equivalent to Project
    2. Step equivalent to Job
    3. Every job only could be start after all predecessor job finished
    4. Every job need to use some resources

    Does it make sense for you to start from there?.. If the answer is no, you should really provide more information or at least some code that you have already tried, because I think your question is too general and not really related to optaplanner. Hope this helps, kind regards.