optaplanner - Multiple ValueSelector for one MoveSelector -
How can I set multiple value selectors for a move selector in Optaplanner? Documentation that clearly says: "A MoveSelector is often made out EntitySelectors, ValueSelectors or other MoveSelectors, which can be individually configured if desired", which I assume multiple value selectors One can be assigned that means move the selector, which I understand, although I get an unashashing error.
& lt; UnionMoveSelector & gt; & Lt; ChangeMoveSelector & gt; & Lt; EntitySelector & gt; & Lt; EntityClass & gt; Com.rdthree.plenty.domain.activity.Activity & lt; / EntityClass & gt; & Lt; / EntitySelector & gt; & Lt; ValueSelector & gt; & Lt; VariableName & gt; STARTTIME & lt; / VariableName & gt; & Lt; / ValueSelector & gt; & Lt; ValueSelector & gt; & Lt; VariableName & gt; ENDTIME & lt; / VariableName & gt; & Lt; / ValueSelector & gt; & Lt; - This is the line where the error & lt; FilterClass & gt; From MyClass (do not want to name it) & lt; / FilterClass & gt; & Lt; / ChangeMoveSelector & gt; & Lt; / UnionMoveSelector & gt; Error:
java.lang.IllegalArgumentException: Unmarshalling (activitySolverConfig.xml) of solverConfigResource fails. Reason:
to debug because: com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter $ DuplicateFieldException: Duplicate field valueSelectorConfig ---- information - --- area: valueSelectorConfig class: org.optaplanner.core.config.heuristic.selector.move.generic.ChangeMoveSelectorConfig required type: org.optaplanner.core.config.heuristic.selector.move.generic.ChangeMoveSelectorConfig converter type : com.thoughtworks.xstream.converters.reflection.ReflectionConverter line number: 36 class [1]: org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig class [2]: org.optaplanner.core.config . Localsearch.LocalSearchPhaseConfig class [3]: org.optaplanner.core.config.solver.SolverConfig version: 1.4.7 -------------------------- ----- I am not copying the entire error text, but I can assure you that it is mentioned fact that I have two value selectors.
A changeMoveSelector can currently 1 valueSelector .
I think you want a cartesian product (otherwise you can use those 2 changeMoveSelector ) / code> S, such as:
& carton; Productive producer & gt; & Lt; ChangeMoveSelector & gt; & Lt; EntitySelector id = "Cartesian Product Entity Selector" and> gt; & Lt; ValueSelector & gt; & Lt; VariableName & gt; STARTTIME & lt; / VariableName & gt; & Lt; / ValueSelector & gt; & Lt; / ChangeMoveSelector & gt; & Lt; ChangeMoveSelector & gt; & Lt; Unit Selector Copy Selector REF = "Cartesian Product Entity Chooser" /> & Lt; ValueSelector & gt; & Lt; VariableName & gt; ENDTIME & lt; / VariableName & gt; & Lt; / ValueSelector & gt; & Lt; / ChangeMoveSelector & gt; & Lt; / CartesianProductMoveSelector & gt; This means that a single step (a compositemov) changes both the initial time and the last time of 1 (and one) unit. See the Docs section about copying selection for cartesianProductMoveSelector for more information.
Note that this association cartesianProductMoveSelector can be nested in a unionMoveSelector if the other moves combination s Want to keep in
Comments
Post a Comment