[
https://issues.jboss.org/browse/JBRULES-3450?page=com.atlassian.jira.plug...
]
Geoffrey De Smet updated JBRULES-3450:
--------------------------------------
Summary: Planner: Terminate Solver as soon as a feasible score is found - should be
made easier to configure (was: Planner: Terminate Solver as soon as a feasible score is
found)
Planner: Terminate Solver as soon as a feasible score is found -
should be made easier to configure
---------------------------------------------------------------------------------------------------
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
Labels: starter
[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