Add DepthLimitedTreeSearch tests + fix LabeledGraphTest Pair import#543
Open
gkneighb wants to merge 2 commits intoaimacode:AIMA4efrom
Open
Add DepthLimitedTreeSearch tests + fix LabeledGraphTest Pair import#543gkneighb wants to merge 2 commits intoaimacode:AIMA4efrom
gkneighb wants to merge 2 commits intoaimacode:AIMA4efrom
Conversation
…beledGraphTest The javafx.util.Pair import broke compilation on JDKs without bundled JavaFX (e.g. Zulu CA) and was removed from the JDK in Java 11. The project already exposes its own Pair with the constructor and equals semantics this test uses. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers the algorithm's three return modes — solution, cutoff (null), and failure (empty list) — across the Romania map and binary-tree fixtures, plus a vacuum-world case that documents the non-minimal path DLS-tree produces when LEFT is a no-op at the leftmost square (no cycle check in tree search). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DepthLimitedTreeSearchcovering the algorithm's three return modes — solution, cutoff (null), and failure (empty list) — using the Romania map and binary-tree fixtures already inProblemFactory. Includes a vacuum-world case that documents the non-minimal path DLS-tree returns when LEFT is a no-op at the leftmost square (no cycle check in tree search).LabeledGraphTest:import javafx.util.Pairdoes not resolve on JDKs without bundled JavaFX (Zulu CA, etc.) and was removed from the JDK in Java 11. Swapped to the project's ownaima.core.util.datastructure.Pair, whose constructor andequalsmatch what the test uses.Addresses the README TODO: "Chapter 3 'core' module: Add tests for all implemented algorithms."
Full
:test:testsuite: 1272 tests, 0 failures, 0 errors after the change (vs. the suite previously failing to compile due to the JavaFX import on a JavaFX-less JDK 8).Test plan
./gradlew :test:test --tests aima.test.unit.search.uninformed.DepthLimitedTreeSearchTest— 8/8 pass./gradlew :test:test— 1272/1272 pass on Zulu OpenJDK 8 aarch64🤖 Generated with Claude Code