<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Hi,</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;">Since I am using my custom move implementation I get:<br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div> 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.<br> at org.drools.planner.core.score.director.drools.DroolsScoreDirector.afterVariableChanged(DroolsScoreDirector.java:125)<br> at my.planner.solver.ProjectMove.moveTask(ProjectMove.java:182)<br> at
my.planner.solver.ProjectMove.doMove(ProjectMove.java:125)<br> at org.drools.planner.core.localsearch.decider.DefaultDecider.doMove(DefaultDecider.java:143)<br> at org.drools.planner.core.localsearch.decider.DefaultDecider.decideNextStep(DefaultDecider.java:116)<br> at org.drools.planner.core.localsearch.DefaultLocalSearchSolverPhase.solve(DefaultLocalSearchSolverPhase.java:62)<br> at org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:190)<br> at org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:155)<br> at my.planner.app.InspectionSchedule.solve(InspectionSchedule.java:188)<br> at my.planner.app.InspectionPlanning.main(InspectionPlanning.java:27)<br><br>It happens during LocalSearch Phase in my custom move implementation.<br><br>I caught this exception and printed the hashcode of
the entity.<br>I also printed the hashcodes of all entities in my cloneSolution method and they match.<br>Furthermore when catching the exception I loop through the <br>((InspectionSchedule)scoreDirector.getWorkingSolution()).getTasks() array and again I find the task with that hashcode.<br>It is ((InspectionSchedule)scoreDirector.getWorkingSolution()).getTasks() that holds the tasks and that is populated when cloning the solution.<br><br>It does not happen in every test... only in some, but then it's consistently.<br><br>Are there any other things I can check to see where I'm going bad?<br><br>Thanks<br><br>Michiel<br><br></div><div>-----------------<br>http://www.codessentials.com - Your essential software, for free!<br>Follow us at http://twitter.com/#!/Codessentials</div></div></body></html>