optaplanner - When constraintMatchEnabled (false) is disabled, this method should not be called -


i trying use score director in optaplnner :

 solver solver = solverfactory.buildsolver();  scoredirectorfactory scoredirectorfactory = solver.getscoredirectorfactory();  scoredirector guiscoredirector = scoredirectorfactory.buildscoredirector();   (constraintmatchtotal constraintmatchtotal :guiscoredirector.getconstraintmatchtotals()) {   } 

but getting following exception when call getconstraintmatchtotals method:

 when constraintmatchenabled (false) disabled, method should not called.. stacktrace follows:     message: when constraintmatchenabled (false) disabled, method should not called.         line | method     ->>  140 | getconstraintmatchtotals in org.optaplanner.core.impl.score.director.abstractscoredirector     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -      |     57 | solve                    in com.volcare.optaplanner.taskplanningcontroller     |     97 | index . . . . . . . . .  in     ''     |    200 | dofilter                 in grails.plugin.cache.web.filter.pagefragmentcachingfilter     |     63 | dofilter . . . . . . . . in grails.plugin.cache.web.filter.abstractfilter     |   1145 | runworker                in java.util.concurrent.threadpoolexecutor     |    615 | run . . . . . . . . . .  in java.util.concurrent.threadpoolexecutor$worker     ^    744 | run                      in java.lang.thread 

solverconfig.xml

  <!-- score configuration -->   <scoredirectorfactory>     <scoredefinitiontype>hard_soft_big_decimal</scoredefinitiontype>     <simplescorecalculatorclass>com.volcare.optaplanner.taskplanscorecalculator</simplescorecalculatorclass>     <!-- <scoredrl>/taskplanningscorerules.drl</scoredrl> -->   </scoredirectorfactory> 

simplescorecalculator (now called easyscorecalculator) not support constraint matches. solutions:

  1. use drools score calc (by using <scoredrl> instead of <simplescorecalculatorclass> in config. drools rule engine smart enough not calculate score, explain telling constraint matches.

  2. for incrementalscorecalculator added interface constraintmatchawareincrementalscorecalculator, user can expose them (but unlike in drools doesn't work magically - there's work do). think should support similar interfacef or easy score calculation (constraintmatchawareeasyscorecalculator).

note: error message got not clear, 've improved error message in 6.2.0.beta2. check if error message clearer once that's released.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -