@@ -74,7 +74,7 @@ public abstract class AbstractScoreDirector<Solution_, Score_ extends Score<Scor
7474 private final @ Nullable LookupManager lookUpManager ;
7575 protected final ConstraintMatchPolicy constraintMatchPolicy ;
7676 private boolean expectShadowVariablesInCorrectState ;
77- private boolean ignoreInconsistentSolutions ;
77+ private final boolean ignoreInconsistentSolutions ;
7878 private final VariableDescriptorCache <Solution_ > variableDescriptorCache ;
7979 protected final ShadowVariableSupport <Solution_ > shadowVariableSupport ;
8080 private final @ Nullable SolutionTracker <Solution_ > solutionTracker ; // Null when tracking disabled.
@@ -110,7 +110,7 @@ protected AbstractScoreDirector(AbstractScoreDirectorBuilder<Solution_, Score_,
110110 this .lookUpManager = lookUpEnabled ? new LookupManager (solutionDescriptor .getLookUpStrategyResolver ()) : null ;
111111 this .constraintMatchPolicy = builder .constraintMatchPolicy ;
112112 this .expectShadowVariablesInCorrectState = builder .expectShadowVariablesInCorrectState ;
113- this .ignoreInconsistentSolutions = builder . ignoreInconsistentSolutions ;
113+ this .ignoreInconsistentSolutions = ! solutionDescriptor . hasAnyShadowVariablesInconsistentMember () ;
114114 this .variableDescriptorCache = new VariableDescriptorCache <>(solutionDescriptor );
115115 this .shadowVariableSupport = ShadowVariableSupport .create (this );
116116 this .shadowVariableSupport .linkShadowVariables ();
@@ -524,7 +524,6 @@ public InnerScoreDirector<Solution_, Score_> createChildThreadScoreDirector(Chil
524524 var childThreadScoreDirector = scoreDirectorFactory .createScoreDirectorBuilder ()
525525 .withLookUpEnabled (lookUpEnabled )
526526 .withConstraintMatchPolicy (constraintMatchPolicy )
527- .withIgnoreInconsistentSolutions (ignoreInconsistentSolutions )
528527 .buildDerived ();
529528 // ScoreCalculationCountTermination takes into account previous phases
530529 // but the calculationCount of partitions is maxed, not summed.
@@ -534,7 +533,6 @@ public InnerScoreDirector<Solution_, Score_> createChildThreadScoreDirector(Chil
534533 var childThreadScoreDirector = scoreDirectorFactory .createScoreDirectorBuilder ()
535534 .withLookUpEnabled (true )
536535 .withConstraintMatchPolicy (constraintMatchPolicy )
537- .withIgnoreInconsistentSolutions (ignoreInconsistentSolutions )
538536 .buildDerived ();
539537 childThreadScoreDirector .setWorkingSolution (cloneWorkingSolution ());
540538 return childThreadScoreDirector ;
@@ -807,7 +805,6 @@ private void assertScoreFromScratch(InnerScore<Score_> innerScore, Object comple
807805 // Most score directors don't need derived status; CS will override this.
808806 try (var uncorruptedScoreDirector = assertionScoreDirectorFactory .createScoreDirectorBuilder ()
809807 .withConstraintMatchPolicy (ConstraintMatchPolicy .ENABLED )
810- .withIgnoreInconsistentSolutions (ignoreInconsistentSolutions )
811808 .buildDerived ()) {
812809 uncorruptedScoreDirector .setWorkingSolution (workingSolution );
813810 var uncorruptedInnerScore = uncorruptedScoreDirector .calculateScore ();
@@ -1006,7 +1003,6 @@ public abstract static class AbstractScoreDirectorBuilder<Solution_, Score_ exte
10061003 protected ConstraintMatchPolicy constraintMatchPolicy = ConstraintMatchPolicy .DISABLED ;
10071004 protected boolean lookUpEnabled = false ;
10081005 protected boolean expectShadowVariablesInCorrectState = true ;
1009- protected boolean ignoreInconsistentSolutions = false ;
10101006
10111007 protected AbstractScoreDirectorBuilder (Factory_ scoreDirectorFactory ) {
10121008 this .scoreDirectorFactory = Objects .requireNonNull (scoreDirectorFactory );
@@ -1030,12 +1026,6 @@ public Builder_ withExpectShadowVariablesInCorrectState(boolean expectShadowVari
10301026 return (Builder_ ) this ;
10311027 }
10321028
1033- @ SuppressWarnings ("unchecked" )
1034- public Builder_ withIgnoreInconsistentSolutions (boolean ignoreInconsistentSolutions ) {
1035- this .ignoreInconsistentSolutions = ignoreInconsistentSolutions ;
1036- return (Builder_ ) this ;
1037- }
1038-
10391029 public abstract AbstractScoreDirector <Solution_ , Score_ , Factory_ > build ();
10401030
10411031 /**
0 commit comments