OptaPlanner - A planning entity is an instance of an entitySubclass (class java.lang.Integer) that is not configured as a planning entity. -
i have been trying implement custom construction heuristic
in optaplanner on problem similar nurse rostering one.
everything seems annotated correctly, , added solverconfiguration
, keep getting error:
exception in thread "main" java.lang.illegalargumentexception: planning entity instance of entitysubclass (class java.lang.integer) not configured planning entity. if class (integer) (or superclass thereof) not entityclass ([class org.optaplanner.examples.nurserostering.domain.skillrequirement, class org.optaplanner.examples.nurserostering.domain.shiftassignment]), check solution implementation's annotated methods. if is, check solver configuration. @ org.optaplanner.core.impl.domain.solution.descriptor.solutiondescriptor.findentitydescriptororfail(solutiondescriptor.java:398) @ org.optaplanner.core.impl.domain.solution.descriptor.solutiondescriptor.findvariabledescriptororfail(solutiondescriptor.java:443) @ org.optaplanner.core.impl.score.director.abstractscoredirector.beforevariablechanged(abstractscoredirector.java:226) @ org.optaplanner.examples.nurserostering.domain.solver.customconstructionheuristic.changeworkingsolution (customconstructionheuristic.java:86) @ org.optaplanner.core.impl.phase.custom.defaultcustomphase.dostep(defaultcustomphase.java:89) @ org.optaplanner.core.impl.phase.custom.defaultcustomphase.solve(defaultcustomphase.java:71) @ org.optaplanner.core.impl.solver.defaultsolver.runphases(defaultsolver.java:214) @ org.optaplanner.core.impl.solver.defaultsolver.solve(defaultsolver.java:176) @ org.optaplanner.examples.nurserostering.app.nurserosterconsoleapp.main(nurserosterconsoleapp.java:142)
i tried fix using these references:
optaplanner xml configuration , entitysubclass not configured planning entity error
optaplanner: java.lang.illegalargumentexception
https://groups.google.com/forum/#!topic/optaplanner-dev/wcdesqhgdaq
so far nothing worked. clues on how can solve this?
yea, error message isn't 100% user friendly yet, 'll fix 7.0.
anyway, what's it's saying got in solution class:
@planningentitycollectionproperty public list<object> getmyentities() { list<object> entities = new arraylist<>(); entities.add(integer.valueof(1)); ... return entities; }
so you're adding integer collection should exist out of entities (so out of instances of skillrequirement or shiftassignment).
ps: it's weird skillrequirement planning entity, might want give class better name in variation of nurse rostering.
Comments
Post a Comment