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

Garf JonGarfunkel at gmail.com
Wed Jul 11 11:19:53 EDT 2012


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./

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.


More information about the rules-users mailing list