[rules-users] Planner - Initialized solution & local search

Geoffrey De Smet ge0ffrey.spam at gmail.com
Wed Jul 11 11:52:39 EDT 2012




Op 11-07-12 17:19, Garf schreef:
> I'm using v5.4. I've built a prototype which uses the constructionHeuristic,
> and localSearch, as the example does, and am able to run the solver (though
> it still doesn't do a good job of solving at this point).
>
> I've now added customSolverPhase, and set it to use an initializer class
> which implements CustomSolverPhaseCommand.
>
> In my changeWorkingSolution, I call scoreDirector.beforeEntityAdded(), and
> then set the planning entity's planning variable, and then call
> afterEntityAdded().
>
> If I leave any entities unadded -- and let the constructionHeuristic
> (BEST_FIT, etc) do the fitting (which I can verify from the logs)-- I then
> get this exception:
>
> /java.lang.IllegalStateException: Phase localSearch started with an
> uninitialized Solution. First initialize the Solution. For example, run a
> phase constructionHeuristic first./
This sounds like a bug.
Unless, you called afterEntityAdded() on the non initialized entities too?

If that's not the case, could you file a jira?
   https://issues.jboss.org/browse/JBRULES
> For now, I can update my code to ensure that all of the entities are fitted
> and bypass the constructionHeuristic, but I'm curious why this error is
> getting thrown. I did hunt through the source code to look at all the
> isInitialized() methods, but I haven't yet stepped through to see which one
> returns false any why.
>
> As for turning on TRACE mode, see my
> http://drools.46999.n3.nabble.com/drools-planner-5-4-0-Final-java-lang-IllegalStateException-Score-corruption-the-workingScore-tp3981199p4018558.html
> recent post .
>
> Jon
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/Planner-Initialized-solution-local-search-tp4018594.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>

-- 
With kind regards,
Geoffrey De Smet




More information about the rules-users mailing list