Class PathFinder

java.lang.Object
it.univr.wordautomata.backend.PathFinder

public class PathFinder extends Object
The PathFinder class is responsible for finding a path in a graph based on a given word. It uses a depth-first search algorithm to traverse the graph and find a path that matches the word. The class provides methods to retrieve the path, check if the entire word was consumed, and check if the path ended on a final state.
  • Property Details

    • consumedAllWord

      public static javafx.beans.property.SimpleBooleanProperty consumedAllWordProperty
      Tells if the entire word was consumed.
      See Also:
    • endedOnFinalState

      public static javafx.beans.property.SimpleBooleanProperty endedOnFinalStateProperty
      Tells if the path ended on a final state.
      See Also:
  • Constructor Details

    • PathFinder

      public PathFinder()
  • Method Details

    • getPath

      public static List<com.brunomnsilva.smartgraph.graph.Edge<Transition,State>> getPath(String word, com.brunomnsilva.smartgraph.graph.DigraphEdgeList<State,Transition> graph)
      Finds a path in the graph that matches the given word.
      Parameters:
      word - The word to find a path for.
      graph - The graph to search
      Returns:
      A list of edges representing the path if found, or null if no path is found.
    • getPath

      public static List<com.brunomnsilva.smartgraph.graph.Edge<Transition,State>> getPath(String word)
      Finds a path in the graph that matches the given word
      Parameters:
      word - he word to find a path for.
      Returns:
      A list of edges representing the path if found, or null if no path is found.
    • consumedAllWordProperty

      public static javafx.beans.property.SimpleBooleanProperty consumedAllWordProperty()
      Tells if the entire word was consumed.
      Returns:
      the consumedAllWord property
    • endedOnFinalStateProperty

      public static javafx.beans.property.SimpleBooleanProperty endedOnFinalStateProperty()
      Tells if the path ended on a final state.
      Returns:
      the endedOnFinalState property
    • clearProperties

      public static void clearProperties()
      Clears the properties of the PathFinder.