Package mazealgo.model
Class MazeModel
java.lang.Object
mazealgo.model.MazeModel
High-level model facade for the UI / ViewModel. Two operating modes:
- In-process (no-arg constructor) — generates and solves
directly with
MyMazeGenerator/BestFirstSearch. Used by tests; also a convenient fallback if running the UI withoutMazeApp's embedded servers. - Remote (
MazeModel(int, int)constructor) — talks toMyServerover localhost sockets. The JavaFX app embeds both servers on OS-assigned ports and injects them here, so every Generate / Solution Hint click goes through the Strategy + Decorator-compression + SHA-256 cache pipeline Phase 2 built.
-
Constructor Summary
ConstructorsConstructorDescriptionIn-process mode: algorithms run on the calling thread, no sockets.MazeModel(int generatePort, int solvePort) Remote mode: everygenerate(int, int)/solve(Maze)call opens a fresh localhost socket to the given ports. -
Method Summary
-
Constructor Details
-
MazeModel
public MazeModel()In-process mode: algorithms run on the calling thread, no sockets. -
MazeModel
public MazeModel(int generatePort, int solvePort) Remote mode: everygenerate(int, int)/solve(Maze)call opens a fresh localhost socket to the given ports.
-
-
Method Details
-
generate
-
solve
-
isRemote
public boolean isRemote()
-