0

Using Optaplanner version 6.2.0

My DROOLS Rules:

rule "Transition Time Constraint"
  when
      $leftImageStrip:ImageStrip($selected : selected,
        $satellite : satellite,
        selected != null,
        $timeslot : timeslot,
        leftId : id,
        lGain : gain,
        lRollAngle : rollAngle,
        $duration : duration)

      $rightImageStrip : ImageStrip(selected == $selected,
        satellite == $satellite,
        Math.abs(timeslot.getTime() - $timeslot.getTime()) <= 460000,
        this != $leftImageStrip,
        rGain : gain,
        rRollAngle : rollAngle)
  then
      x = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss.SSS");
      scoreHolder.addHardConstraintMatch(kcontext, -1);
end

rule "Shoot Strip once"
   when
      $leftImageStrip: ImageStrip($selected : selected, $stripList : stripList,
                                leftId : id, selected != null)
      $rightImageStrip: ImageStrip(selected == $selected, stripList == $stripList,
                                this != $leftImageStrip)
   then
      scoreHolder.addMediumConstraintMatch(kcontext, -1);
end

rule "Maximization of Selected Parameters"
   when     
      $imageStrip: ImageStrip(selected != null)
   then
      scoreHolder.addSoftConstraintMatch(kcontext, $imageStrip.gain);
end

I stuck with a local optima that differs according to the input data sorting.

How can I overcome this problem to obtain the same optimum solution what ever the input data sorting is?, and of course it should be the global optimum one.

Can one assures that the obtained result using Optaplanner is the global optima? independent of the input data sorting?

Amr Qamar
  • 99
  • 6

1 Answers1

0

Looks like you have a score trap in the rule "Transition Time Constraint". See docs for the keyword "Score Trap". Fixing that can make a very big difference to escape local optima and get good results. Something like this would fix it (from the top of my head, might be inverted):

scoreHolder.addHardConstraintMatch(kcontext, ... 460000 - Math.abs(timeslot.getTime() - $timeslot.getTime()) ...);

Once that's fixed, looked at your average score count per second (last log line or benchmarker report).

That being said, metaheuristics (such as Local Search) aren't about finding the global optimum solution. They're about finding the best possible solution when scaling out in reasonable time, better than any other technology can give you in the time you have available when scaling out (see research compo's such as ROADEF, ITT and INRC for proof - all technologies that claim to find the global optimum don't scale). The downside of this is that metaheuristics don't always scale down well (only up).

Note: A common sales trick is to present a technology that finds the global optimum and then apply partitioning to scale out later during development. The result is not the global optimum of course (due to the nature of NP-complete problems) and it's not any good (relatively speaking). The quality loss due to partitioning is huge.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • Do version 6.3.0 solves this problem? If so I can change using it. – Amr Qamar Nov 04 '15 at 11:30
  • What I've understood from the docs that this happens when the score level are the same, but my problem has only one hard, one soft, and one medium. If I understood wright...! So using (... -1 ...) to penalty the constraint would not affect the result. Am I understanding the case perfectly??? – Amr Qamar Nov 04 '15 at 11:36
  • Mr Geoffrey De Smet would you help me solving this problem? tell me if I'm understanding your answer and what's written in the docs. – Amr Qamar Nov 05 '15 at 12:25