I am new to OptaPlanner and having some diffculty in configuring the solution. I have anotated all of the classes correctly but I am getting the following error when the solver runs.
A planning entity is an instance of a entitySubclass (class
org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector) that is not
configured as a planning entity.
If that class (DroolsScoreDirector) (or superclass thereof) is not a entityClass
([...Part]), check your Solution implementation's annotated methods.
If it is, check your solver configuration
Here is the xml configuration I am currently using.
<?xml version="1.0" encoding="UTF-8"?>
<solver>
<solutionClass>(package name).SheetNesting</solutionClass>
<planningEntityClass>(package name).Part</planningEntityClass>
<scoreDirectorFactory>
<scoreDefinitionType>HARD_SOFT</scoreDefinitionType>
<scoreDrl>/Resources/Drools/NestingRules.drl</scoreDrl>
</scoreDirectorFactory>
<termination>
<maximumSecondsSpend>500</maximumSecondsSpend>
</termination>
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>
</constructionHeuristic>
<localSearch>
<unionMoveSelector>
<changeMoveSelector>
<valueSelector>
<variableName>sheet</variableName>
</valueSelector>
</changeMoveSelector>
<moveListFactory>
<moveListFactoryClass>(package name).XPosMoveFactory</moveListFactoryClass>
</moveListFactory>
<moveListFactory>
<moveListFactoryClass>(package name).YPosMoveFactory</moveListFactoryClass>
</moveListFactory>
</unionMoveSelector>
<acceptor>
<lateAcceptanceSize>600</lateAcceptanceSize>
</acceptor>
<forager>
<acceptedCountLimit>4</acceptedCountLimit>
</forager>
</localSearch>
</solver>
The output shows that the solution establishes (possible evaluates Phase(0) but then the error is thrown. Any help will be appreciated.
*EDIT Firstly thank you for your comments. The definition of the Part class is as follows
@PlanningEntity(difficultyComparatorClass = PartComparator.class)
public class Part
{
....
@PlanningVariable(valueRangeProviderRefs = {"sheetRange"})
public Sheet getSheet()
{
....
}
@PlanningVariable(valueRangeProviderRefs = {"xPosRange"})
public double getXCenter()
{
....
}
@PlanningVariable(valueRangeProviderRefs = {"yPosRange"})
public double getYCenter()
{
....
}
}
As you can see the class is fully annotated, as described. This is why I believed the issue was with the configuration.