Thank you!<br><br><div class="gmail_quote">On 5 May 2012 15:35, Geoffrey De Smet <span dir="ltr"><<a href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div text="#000000" bgcolor="#ffffff">
<br>
<br>
Op 05-05-12 08:50, Nurlan schreef:
<div class="im"><blockquote type="cite">
<pre>Hi guys!
I'm using drools-planner-*5.4.0.CR1*...
Let's say I have some solution(NOT FINAL BEST SOLUTION) which done by human
manually and I want get list of broken contraints for that solution, I've
tried
        this.scoreDirector.setWorkingSolution(someSolution);
        this.scoreDirector.calculateScore();
</pre>
</blockquote></div>
Something like that should work. For the exact correct usage, see
the new section for the 5.4.0.Final manual:<br>
<a href="https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/drools-planner/lastSuccessfulBuild/artifact/drools-planner-docs/target/docbook/publish/en-US/html_single/index.html#d0e3786" target="_blank">https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/drools-planner/lastSuccessfulBuild/artifact/drools-planner-docs/target/docbook/publish/en-US/html_single/index.html#d0e3786</a><br>
It should never return null. I do in the examples all the time.<br>
<br>
There is a point though, that the code above still requires the
creation of a Solver (but it doesn't you to actually run it):<br>
<pre><a><span>ScoreDirectorFactory</span><span> scoreDirectorFactory </span><span>=</span><span> solverFactory.buildSolver()</span><span>.</span><span>getScoreDirectorFactory</span><span>();</span>
<span>ScoreDirector</span><span> guiScoreDirector </span><span>=</span><span> scoreDirectorFactory</span><span>.</span><span>buildScoreDirector</span><span>();
</span></a><a><span>guiScoreDirector</span><span>.</span><span>setWorkingSolution</span><span>(</span><span>solution</span><span>);</span>
<span>Score</span><span> score </span><span>=</span><span> guiScoreDirector</span><span>.</span><span>calculateScore</span><span>();</span></a><a>
</a></pre>
Feel free to make a jira if you agree that it shouldn't be needed to
do a ".buildSolver()" in that code.<div class="im"><br>
<br>
<blockquote type="cite">
<pre>it returns *null* since it isn't connected with Solver
then I've tried using Solver with
<termination><maximumStepCount>0</maximumStepCount></termination>:
        this.scoreDirector.setWorkingSolution(someSolution);
        this.solver.setPlanningProblem(this.scoreDirector.getWorkingSolution());
        
        this.solver.solve();
                
        this.scoreDirector.setWorkingSolution(this.solver.getBestSolution());
        this.scoreDirector.calculateScore();
then it shows *java.lang.UnsupportedOperationException* because there is no
best solution in Solver
java.lang.UnsupportedOperationException: StepCountTermination can only be
used for phase termination.
        at
org.drools.planner.core.termination.StepCountTermination.isSolverTerminated(StepCountTermination.java:40)
        at
org.drools.planner.core.termination.OrCompositeTermination.isSolverTerminated(OrCompositeTermination.java:42)
        at
org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:181)
        at
org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:151)
how can implement this task? or I have to implement setBestSolution in
Solver, i think this is bad idea...
</pre>
</blockquote></div>
bad idea indeed<div class="im"><br>
<blockquote type="cite">
<pre>--
View this message in context: <a href="http://drools.46999.n3.nabble.com/getting-list-of-broken-constraints-for-some-solution-NOT-BEST-SOLUTION-in-drools-planner-tp3964160.html" target="_blank">http://drools.46999.n3.nabble.com/getting-list-of-broken-constraints-for-some-solution-NOT-BEST-SOLUTION-in-drools-planner-tp3964160.html</a>
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</div><span class="HOEnZb"><font color="#888888"><pre cols="72">--
With kind regards,
Geoffrey De Smet</pre>
</font></span></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div style="font-size:100%;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:3px;padding-right:3px;padding-bottom:3px;padding-left:3px;background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:'Times New Roman'">
Regards, </div><div style="font-size:100%;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:3px;padding-right:3px;padding-bottom:3px;padding-left:3px;background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:'Times New Roman'">
Nurlan Rakhimzhanov</div><br>