Class TargetMotionLocaliser<T extends GroupDetection>

Type Parameters:
T -
All Implemented Interfaces:
LocalisationAlgorithm, LocalisationAlgorithmInfo

public class TargetMotionLocaliser<T extends GroupDetection> extends AbstractLocaliser<T> implements LocalisationAlgorithm, LocalisationAlgorithmInfo
Reinstated Target motion add-in as used by the click detector. Hope one day still to replace this with Jamie's new one, but keep this one until Jamie's is working.
Author:
Doug Gillespie
  • Field Details Link icon

    • currentEventIndex Link icon

      public int currentEventIndex
      Database index of current event. Not the same as the eventListIndex

      Use index instead of reference since the data are often reloaded, so references become out of date.

  • Constructor Details Link icon

  • Method Details Link icon

    • getLocaliserName Link icon

      public String getLocaliserName()
      Specified by:
      getLocaliserName in class AbstractLocaliser<T extends GroupDetection>
      Returns:
      a name for the localiser for use in dialogs, menus, etc.
    • getAlgorithmInfo Link icon

      public LocalisationAlgorithmInfo getAlgorithmInfo()
      Description copied from interface: LocalisationAlgorithm
      Get information about the localisation algorithm.
      Specified by:
      getAlgorithmInfo in interface LocalisationAlgorithm
      Returns:
      algorithm information.
    • localiseDataUnit Link icon

      public boolean localiseDataUnit(T dataUnit)
      Description copied from class: AbstractLocaliser
      Localise a data unit.

      Localisation results will be added to the data unit itself in the AbstractLocalisation field.

      Specified by:
      localiseDataUnit in class AbstractLocaliser<T extends GroupDetection>
      Parameters:
      dataUnit - data unit to localise
      Returns:
      true if localisation was successful.
    • getEventMenuItem Link icon

      public JMenuItem getEventMenuItem(T pamDetection)
      Get a menu item to insert into a pop-up menu for a single event (i.e. right click on click train and get this menu). Use the default datablock data name in the menu title.
      Parameters:
      pamDetection - detection to include in menu action.
      Returns:
      menu item or null if action on the detection is not possible
    • getEventMenuItem Link icon

      public JMenuItem getEventMenuItem(T pamDetection, String dataName)
      Get a menu item to insert into a pop-up menu for a single event using a specific name for the data (database index will be appended to this name)
      Parameters:
      pamDetection - data unit to include in the menu action
      dataName - data name to include in the meny text
      Returns:
      menu item or null if action on the detection is not possible
    • showTMDialog Link icon

      public boolean showTMDialog(T dataUnit)
    • addDetectorMenuItems Link icon

      public int addDetectorMenuItems(Frame parentFrame, JMenu menu)
    • checkDataLoadTime Link icon

      public boolean checkDataLoadTime(T event)
    • clearResults Link icon

      public void clearResults()
    • getResults Link icon

      public ArrayList<GroupLocResult> getResults()
    • addResults Link icon

      public void addResults(GroupLocResult[] newResults)
    • getBestResultIndex Link icon

      public int getBestResultIndex()
      Returns:
      the bestResultIndex
    • setBestResultIndex Link icon

      public void setBestResultIndex(int bestResultIndex)
      Parameters:
      bestResultIndex - the bestResultIndex to set
    • getDataBlock Link icon

      public PamDataBlock<T> getDataBlock()
      Overrides:
      getDataBlock in class AbstractLocaliser<T extends GroupDetection>
      Returns:
      the dataBlock
    • getModels Link icon

      public ArrayList<TargetMotionModel<T>> getModels()
    • findModelByName Link icon

      public TargetMotionModel findModelByName(String modelName, boolean shortLength)
      Find a model by it's name. If shortLength is true, then it will accept a match in which the modelName is only partly included in the full model name. This is required since the names in the database may have been truncated and are therefore incomplete.
      Parameters:
      modelName - model name to search for.
      shortLength - allow short model names (if truncated in the database)
      Returns:
      reference to a TM model, or null.
    • dataChanged Link icon

      public void dataChanged(T pamDetection)
      Called when data in the main source data block are changed
      Parameters:
      pamDetection -
    • localiseEventList Link icon

      public void localiseEventList(int[] eventList, TargetMotionModel<T>[] modelList, boolean isSupervised)
    • interractiveCommand Link icon

      public void interractiveCommand(TargetMotionLocaliser.Interractive interractive)
    • getCurrentEvent Link icon

      public T getCurrentEvent()
    • getCurrentEventIndex Link icon

      public int getCurrentEventIndex()
    • setCurrentEventIndex Link icon

      public void setCurrentEventIndex(int currentEventIndex, Object sender)
    • runModels Link icon

      public GroupLocResult[] runModels(T anEvent, DetectionGroupOptions detectionGroupOptions, TargetMotionModel<T>[] modelList)
    • findEvent Link icon

      public T findEvent(int databaseIndex)
      Find an event from it's database index.
      Parameters:
      databaseIndex -
    • selectBestResult Link icon

      public int selectBestResult(GroupLocResult[] results)
      Work out which is the best result based on Chi2 and AIC.
      Parameters:
      results - array of results to compare.
      Returns:
      index of best result, or -1 if there are no results or none with AIC or Chi2 values.
    • getTMLocalisation Link icon

      public TargetMotionLocalisation getTMLocalisation(T event)
      Get the localisation from an event. This will only return if the localisation is of the correct type. Can be used to avoid exceptions if some other sort of localisation has been added to an event
      Parameters:
      event -
      Returns:
      localisation or null if there isn't one or it's the wrong type.
    • getLocalisationContents Link icon

      public int getLocalisationContents()
      Description copied from interface: LocalisationAlgorithmInfo
      Get the likely content flags for this localiser.
      Specified by:
      getLocalisationContents in interface LocalisationAlgorithmInfo
      Returns:
      localisation flags.
      See Also:
    • getAlgorithmName Link icon

      public String getAlgorithmName()
      Description copied from interface: LocalisationAlgorithmInfo
      Get the algorithm name
      Specified by:
      getAlgorithmName in interface LocalisationAlgorithmInfo
      Returns:
      algorithm name
    • getTethysCreator Link icon

      public LocalizationCreator getTethysCreator()
      Description copied from interface: LocalisationAlgorithm
      Get something that can make LocalisationType objects of a form a bit bespoke to the type of localiser. This may be better than having the standard functions in LocalizationBuilder guess what's best.
      Specified by:
      getTethysCreator in interface LocalisationAlgorithm
      Returns:
      can be null in which case standard functions will do the best they can.
    • getParameters Link icon

      public Serializable getParameters()
      Description copied from interface: LocalisationAlgorithmInfo
      Get the algorithm parameters. Something else can turn these into xml for Tethys.
      Specified by:
      getParameters in interface LocalisationAlgorithmInfo
      Returns:
      algorithm parameters object. Might be null;