[jboss-jira] [JBoss JIRA] (JBRULES-3450) Planner: Terminate Solver as soon as a feasible score is found

Geoffrey De Smet (JIRA) jira-events at lists.jboss.org
Fri Apr 6 05:42:47 EDT 2012


Geoffrey De Smet created JBRULES-3450:
-----------------------------------------

             Summary: Planner: Terminate Solver as soon as a feasible score is found
                 Key: JBRULES-3450
                 URL: https://issues.jboss.org/browse/JBRULES-3450
             Project: Drools
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: drools-planner
            Reporter: Geoffrey De Smet
            Priority: Minor


[This is a newbie contributor issue: it's easy to solve for new contributors]

HardAndSoftScore has a method isFeasible(), but it's currently hard to specify that a solver should terminate when a feasible score is attained, because you have to use Integer.MIN_VALUE:
{code}
<termination>
  <scoreAttained>0hard/-2147483648soft</scoreAttained>
<termination>
{code}

Adjust org.drools.planner.config.termination.TerminationConfig
to support this:
{code}
<termination>
  <hardAndSoftScoreFeasible>true</hardAndSoftScoreFeasible>
<termination>
{code}

And copy org.drools.planner.core.termination.ScoreAttainedTermination
to org.drools.planner.core.termination.HardAndSoftScoreFeasibleTermination
to implement it.
Note: the Score will need to be cast to HardAndSoftScore.

Bonus points: write a unit test for it (for inspiration, look at PlanningEntityTabuAcceptorTest).


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list