Class Solution

java.lang.Object
mazealgo.model.algorithms.search.Solution
All Implemented Interfaces:
Serializable

public class Solution extends Object implements Serializable
The path returned by a search algorithm: an ordered list of states from start to goal (inclusive). Built by walking cameFrom from the goal back to the start, then reversing.

Carries the number of nodes the producing algorithm evaluated so the UI can keep its "Nodes: N" counter accurate even when the solve happened on the server (the count survives the ObjectOutputStream roundtrip).

Once constructed, the Solution is fully self-contained — it holds its own list of states and no longer depends on the search algorithm or the visited set.

See Also:
  • Constructor Details

    • Solution

      public Solution(AState goal)
  • Method Details

    • getSolutionPath

      public ArrayList<AState> getSolutionPath()
    • getNodesEvaluated

      public int getNodesEvaluated()
    • setNodesEvaluated

      public void setNodesEvaluated(int nodesEvaluated)