java.lang.Object
io.github.jspinak.brobot.navigation.path.Paths

public class Paths extends Object
Collection of navigation paths in the Brobot model-based GUI automation framework.

Paths manages multiple Path objects representing all discovered routes from a set of starting states to a target state. This collection is the output of pathfinding algorithms and serves as the input for path selection and execution strategies in the Path Traversal Model (ΞΎ).

Key features:

  • Multiple Routes: Stores all valid paths, not just the optimal one
  • Score-based Sorting: Orders paths by quality for intelligent selection
  • Path Cleaning: Removes invalid paths based on active states and failures
  • Best Score Tracking: Identifies the highest quality path available

Path management operations:

  • Sorting: Arranges paths by score (ascending) for optimal selection
  • Cleaning: Filters out paths containing failed transitions or unreachable states
  • Comparison: Determines equivalence between path collections
  • Reporting: Provides formatted output for debugging and analysis

Use cases:

  • Storing pathfinding results for later execution
  • Selecting optimal paths based on current conditions
  • Providing fallback options when primary paths fail
  • Analyzing navigation complexity in the state graph

In the model-based approach, Paths represents the framework's understanding of all possible ways to achieve a navigation goal. This comprehensive view enables robust automation that can adapt to failures, choose optimal routes, and provide insights into the application's navigational structure.

The ability to maintain multiple paths is crucial for handling the stochastic nature of GUI applications, where the optimal path may vary based on current conditions or where primary paths may occasionally fail due to timing or state variations.

Since:
1.0
See Also:
  • Constructor Details

    • Paths

      public Paths()
    • Paths

      public Paths(List<Path> pathList)
  • Method Details

    • isEmpty

      public boolean isEmpty()
    • addPath

      public void addPath(Path path)
    • sort

      public void sort()
    • equals

      public boolean equals(Paths paths)
    • cleanPaths

      public Paths cleanPaths(Set<Long> activeStates, Long failedTransitionStartState)
    • getBestScore

      public int getBestScore()
    • print

      public void print()
    • print

      public void print(StateService stateService)
    • getPaths

      public List<Path> getPaths()