Class CompositeSearchManager

java.lang.Object
edu.tufts.hrilab.vision.stm.SearchManager
edu.tufts.hrilab.vision.stm.CompositeSearchManager

public final class CompositeSearchManager extends SearchManager
  • Method Details

    • addConstraints

      public boolean addConstraints(Map<List<Variable>,? extends List<? extends Term>> separatedDescriptors)
      More efficient alternative to addConstraint when all (or at least more than one) constraints are known at a time.
      Parameters:
      separatedDescriptors -
      Returns:
      if all constraints (descriptors) were met
    • addSearchManager

      public void addSearchManager(List<Variable> variables, SearchManager searchManager)
      Description copied from class: SearchManager
      Add a sub-SearchManager to this SearchManager. This is only valid for SearchManagers that are composed of other SearchManagers.
      Overrides:
      addSearchManager in class SearchManager
    • addConstraint

      public boolean addConstraint(Term term, boolean incrementalImgProcFlag, boolean incrementalDetectorFlag, boolean singleIterationFlag, boolean serialProcessingFlag)
      Add ImageProcessor or Detector constraint. This overloaded method should only be called from the GUI in order to maintain consistency across all uses from the Vision API.
      Specified by:
      addConstraint in class SearchManager
      incrementalImgProcFlag - - if constraint is image processor, should run in incremental mode
      incrementalDetectorFlag - - if constraint is detector, should run in incremental mode
      singleIterationFlag - - if constraint should only run a single iteration
      serialProcessingFlag - - if constraints should run in serial/parallel
      Returns:
      boolean - if predicate mapped to a valid VisionProcessor
    • removeConstraint

      public boolean removeConstraint(Term term)
      Remove constraint from ImageProcessor or Detector. First tries to remove from ImageProcessor constraints, and if nothing was found matching the constraint, then tries to remove Detector (and replace with default Detector). NOTE: doesn't remove Detector yet!!
      Specified by:
      removeConstraint in class SearchManager
      Parameters:
      term - to remove
      Returns:
      True, if was successfully removed. If wasn't contained, returns false.
    • getRelatedTypeIds

      public List<Long> getRelatedTypeIds()
      Description copied from class: SearchManager
      Get a list of SearchManager IDs This is especially important for searches that contain sub-searches like relation
      Overrides:
      getRelatedTypeIds in class SearchManager
      Returns:
    • getFirstVisionProcessor

      public VisionProcess getFirstVisionProcessor()
      Description copied from class: SearchManager
      Get the first VisionProcess in the processing chain for this search. This is usually a detector (but could conceivably be SaliencyOperators in the future).
      Specified by:
      getFirstVisionProcessor in class SearchManager
      Returns:
    • getLastVisionProcessor

      public VisionProcess getLastVisionProcessor()
      Description copied from class: SearchManager
      Get the last VisionProcess in the processing chain for this search. This is usually the Tracker, but can be a Detector and Validator if there is no Tracker (as is the case with sub-SearchMangers in compositeSearchManagers).
      Specified by:
      getLastVisionProcessor in class SearchManager
      Returns:
    • getAllVisionProcessors

      public Set<VisionProcess> getAllVisionProcessors()
      Description copied from class: SearchManager
      Get all of the VisionProcessers in the processing chain for this search. Currently used for the Vision Pipeline GUI
      Specified by:
      getAllVisionProcessors in class SearchManager
    • registerForNotification

      public void registerForNotification(VisionProcess processor)
      Description copied from class: SearchManager
      This allows notifications to be sent between SearchManagers. This SearchManager's Tracker will notify the passed in processor.
      Specified by:
      registerForNotification in class SearchManager
      Parameters:
      processor - VisionProcess to be notified
    • unregisterForNotification

      public void unregisterForNotification(VisionProcess processor)
      Description copied from class: SearchManager
      This allows notifications between SearchManagers to be canceled.
      Specified by:
      unregisterForNotification in class SearchManager
      Parameters:
      processor - VisionProcess to be notified
    • setDetectorIncrementalProcessing

      public void setDetectorIncrementalProcessing(boolean flag)
      Set the incremental processing flag for the Detectors.
      Specified by:
      setDetectorIncrementalProcessing in class SearchManager
      Parameters:
      flag -
    • getDetectorIncrementalProcessing

      public boolean getDetectorIncrementalProcessing()
      Get incremental processing flag for selected Detectors. Returns "incrementalDetectorFlag" if no detector exists (as default preference to use incremental processing).
      Specified by:
      getDetectorIncrementalProcessing in class SearchManager
      Returns:
    • setConstraintsIncrementalProcessing

      public void setConstraintsIncrementalProcessing(boolean flag)
      Set the incremental processing flag for all image processors.
      Specified by:
      setConstraintsIncrementalProcessing in class SearchManager
      Parameters:
      flag -
    • getConstraintsIncrementalProcessing

      public boolean getConstraintsIncrementalProcessing()
      Get incremental processing flag for all image processors. Will print error if they are not consistent. Returns true if no image processors exist (as default preference to use incremental processing).
      Specified by:
      getConstraintsIncrementalProcessing in class SearchManager
      Returns:
    • setSingleIteration

      public void setSingleIteration(boolean flag)
      Specified by:
      setSingleIteration in class SearchManager
    • getSingleIteration

      public boolean getSingleIteration()
      Specified by:
      getSingleIteration in class SearchManager
    • setSerialProcessing

      public void setSerialProcessing(boolean flag)
      Specified by:
      setSerialProcessing in class SearchManager
    • getSerialProcessing

      public boolean getSerialProcessing()
      Specified by:
      getSerialProcessing in class SearchManager
    • isRunning

      public boolean isRunning()
      Is this search currently running.
      Specified by:
      isRunning in class SearchManager
      Returns:
    • start

      protected final void start()
      Start type's detection, tracker, and constraints threads.
      Specified by:
      start in class SearchManager
    • stop

      protected final void stop(boolean wait)
      Stop constraints, detectors, and trackers if they are running.
      Specified by:
      stop in class SearchManager
      Parameters:
      wait - if should wait for everything to stop before returning
    • hasIterationCompleted

      public boolean hasIterationCompleted()
      Description copied from class: SearchManager
      Checks if at least one full detection -> tracking iteration has completed. This is required in order to get detection results.
      Specified by:
      hasIterationCompleted in class SearchManager
      Returns:
    • setTimeOfLastClientUse

      public void setTimeOfLastClientUse(long time)
      Description copied from class: SearchManager
      Update introspection info: time of last client use.
      Specified by:
      setTimeOfLastClientUse in class SearchManager
    • meetsExpectations

      public Collection<TaskAnalysisPolicy.Result> meetsExpectations()
      Description copied from class: SearchManager
      Does the search meet the expectation of its set analysis policy. This is for vision introspection.
      Specified by:
      meetsExpectations in class SearchManager
      Returns: