Hi,

Since I am using my custom move implementation I get:

 Exception in thread "main" java.lang.IllegalArgumentException: The entity ({T= Inspect B747-AX1.I#0 [2->2] Andy TL}) was never added to this ScoreDirector.
    at org.drools.planner.core.score.director.drools.DroolsScoreDirector.afterVariableChanged(DroolsScoreDirector.java:125)
    at my.planner.solver.ProjectMove.moveTask(ProjectMove.java:182)
    at my.planner.solver.ProjectMove.doMove(ProjectMove.java:125)
    at org.drools.planner.core.localsearch.decider.DefaultDecider.doMove(DefaultDecider.java:143)
    at org.drools.planner.core.localsearch.decider.DefaultDecider.decideNextStep(DefaultDecider.java:116)
    at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.solve(DefaultLocalSearchSolverPhase.java:62)
    at org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:190)
    at org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:155)
    at my.planner.app.InspectionSchedule.solve(InspectionSchedule.java:188)
    at my.planner.app.InspectionPlanning.main(InspectionPlanning.java:27)

It happens during LocalSearch Phase in my custom move implementation.

I caught this exception and printed the hashcode of the entity.
I also printed the hashcodes of all entities in my cloneSolution method and they match.
Furthermore when catching the exception I loop through the
((InspectionSchedule)scoreDirector.getWorkingSolution()).getTasks() array and again I find the task with that hashcode.
It is ((InspectionSchedule)scoreDirector.getWorkingSolution()).getTasks() that holds the tasks and that is populated when cloning the solution.

It does not happen in every test... only in some, but then it's consistently.

Are there any other things I can check to see where I'm going bad?

Thanks

Michiel

-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials