Class BiSearch

All Implemented Interfaces:
Runnable, SearchInterface

public class BiSearch extends AbstractSearch
A flexible implementation of the bidirectional heuristic search algorithm described in Pijls, W.H.L.M., Post, H., 2009. "Yet another bidirectional algorithm for shortest paths," Econometric Institute Research Papers EI 2009-10, Erasmus University Rotterdam, Erasmus School of Economics (ESE), Econometric Institute.

The search distance function (Cost) and heuristic estimate (Heuristic) are supplied by the caller.

Author:
Cameron Arshadi
  • Field Details

    • start_x

      protected final int start_x
    • start_y

      protected final int start_y
    • start_z

      protected final int start_z
    • goal_x

      protected final int goal_x
    • goal_y

      protected final int goal_y
    • goal_z

      protected final int goal_z
    • costFunction

      protected final Cost costFunction
    • heuristic

      protected final Heuristic heuristic
    • open_from_start

      protected org.jheaps.AddressableHeap<BiSearchNode,Void> open_from_start
    • open_from_goal

      protected org.jheaps.AddressableHeap<BiSearchNode,Void> open_from_goal
    • closed_from_start_count

      protected long closed_from_start_count
    • closed_from_goal_count

      protected long closed_from_goal_count
    • nodes_as_image

      protected final SearchImageStack<BiSearchNode> nodes_as_image
    • result

      protected Path result
  • Constructor Details

    • BiSearch

      public BiSearch(net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image, ij.measure.Calibration calibration, int start_x, int start_y, int start_z, int goal_x, int goal_y, int goal_z, int timeoutSeconds, long reportEveryMilliseconds, SNT.SearchImageType searchImageType, Cost costFunction, Heuristic heuristic)
    • BiSearch

      public BiSearch(SNT snt, net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> image, int start_x, int start_y, int start_z, int goal_x, int goal_y, int goal_z, Cost costFunction, Heuristic heuristic)
    • BiSearch

      public BiSearch(SNT snt, int start_x, int start_y, int start_z, int goal_x, int goal_y, int goal_z, Cost costFunction, Heuristic heuristic)
    • BiSearch

      public BiSearch(SNT snt, int start_x, int start_y, int start_z, int goal_x, int goal_y, int goal_z)
  • Method Details

    • run

      public void run()
    • expandNeighbors

      protected void expandNeighbors(BiSearchNode p, boolean fromStart)
    • reconstructPath

      protected Path reconstructPath(double x_spacing, double y_spacing, double z_spacing, String spacing_units)
    • addProgressListener

      public void addProgressListener(SearchProgressCallback callback)
      Description copied from class: AbstractSearch
      Registers a callback to receive progress updates during the search.
      Specified by:
      addProgressListener in class AbstractSearch
    • reportFinished

      public void reportFinished(boolean success)
    • pointsConsideredInSearch

      public long pointsConsideredInSearch()
      Description copied from class: AbstractSearch
      Returns the total number of points evaluated so far during the search.
      Specified by:
      pointsConsideredInSearch in class AbstractSearch
    • checkStatus

      protected boolean checkStatus()
    • getResult

      public Path getResult()
    • printStatus

      public void printStatus()
      Description copied from class: AbstractSearch
      Prints the current search status to the log.
      Specified by:
      printStatus in class AbstractSearch
    • reportPointsInSearch

      protected void reportPointsInSearch()
      Specified by:
      reportPointsInSearch in class AbstractSearch
    • getNodesAsImage

      public SearchImageStack<BiSearchNode> getNodesAsImage()