Skip to content

fix: Handle null planning values in ValueTabuAcceptor#2200

Open
paoloantinori wants to merge 1 commit intoTimefoldAI:mainfrom
paoloantinori:fix/null-planning-values-in-value-tabu-acceptor
Open

fix: Handle null planning values in ValueTabuAcceptor#2200
paoloantinori wants to merge 1 commit intoTimefoldAI:mainfrom
paoloantinori:fix/null-planning-values-in-value-tabu-acceptor

Conversation

@paoloantinori
Copy link

Fixes #2199

Summary

ValueTabuAcceptor throws NullPointerException when processing moves with nullable planning variables that contain null values. The null values represent "unassigned" state and cannot be tracked in the tabu deque.

Root Cause

AbstractTabuAcceptor.adjustTabuList() tried to add null elements directly to ArrayDeque, which throws NullPointerException.

Fix

Skip null values in adjustTabuList() before adding to tabu tracking structures. Null planning values represent "unassigned" state and tracking them as tabu has no meaningful purpose.

Test

Added nullablePlanningValue() test in ValueTabuAcceptorTest which verifies:

  • Moves with null planning values don't throw NPE
  • Null values are skipped (not tracked as tabu)
  • Non-null values are correctly tracked as tabu

ValueTabuAcceptor threw NullPointerException when processing
moves with nullable planning variables that contain null values.
The null values represent "unassigned" state and cannot be
tracked in the tabu deque.

Root cause: AbstractTabuAcceptor.adjustTabuList() tried to add null
elements directly to ArrayDeque, which throws NullPointerException.

Fix: Skip null values in adjustTabuList() before adding to the
tabu tracking structures. Null planning values are semantically
"unassigned" and tracking them as tabu has no meaningful purpose.

Added test: nullablePlanningValue() verifies the fix and ensures
null values are skipped while non-null values are correctly tracked.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NullPointerException in ValueTabuAcceptor with nullable planning variables

1 participant