Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-1126

could not remove constraintMatch in FULL ASSERT

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Critical Critical
    • None
    • 7.5.0.Final
    • optaplanner-core
    • None
    • Hide

      To reproduce the problem:

      git reset --hard constraintMatch

      • launch the following class: /shareable-ta/src/main/java/app/Main.java
      Show
      To reproduce the problem: git reset --hard constraintMatch launch the following class: /shareable-ta/src/main/java/app/Main.java
    • NEW
    • NEW

      Running the solver, I got this error
      The constraintMatchTotal (...) could not remove constraintMatch (..) from its constraintMatchSet

      Exception in thread "main" java.lang.IllegalStateException: The constraintMatchTotal (solver/Same employee - Keep parts together=[0]hard/[-12/0/0]soft) could not remove constraintMatch (solver/Same employee - Keep parts together/[[TaskPart [id=02-1, 
      ...
      [0]hard/[-1/0/0]soft]).
      	at org.optaplanner.core.api.score.constraint.ConstraintMatchTotal.removeConstraintMatch(ConstraintMatchTotal.java:107)
      	at org.optaplanner.core.api.score.holder.AbstractScoreHolder$ConstraintActivationUnMatchListener.run(AbstractScoreHolder.java:137)
      	at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector$OptaplannerRuleEventListener.undoPreviousMatch(DroolsScoreDirector.java:103)
      	at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector$OptaplannerRuleEventListener.onDeleteMatch(DroolsScoreDirector.java:96)
      	at org.drools.core.event.RuleEventListenerSupport.lambda$onDeleteMatch$2(RuleEventListenerSupport.java:33)
      
      
      

      It seems related with the following rule:

      rule "Same employee - Keep parts together"
          when
          	$tp : TaskPart (task.maxParts > 1, $e : employee, $t : task)
          	$parts : List( size > 1 ) from collect ( TaskPart ( task == $t, employee == $e ) )
              exists TaskPart ( employee == $e, 
              			     task == $t,
                               previousTaskPartOrEmployee not memberOf $parts,
                               nextTaskPart not memberOf $parts )
          then
             	scoreHolder.addSoftConstraintMatch(kcontext, 0, -1 );
      end
      

      Basically this rules try to check if there is an isolated task part.

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              dmarrazz@redhat.com Donato Marrazzo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: