Package targetMotionOld
Class TargetMotionLocaliser<T extends GroupDetection>
java.lang.Object
Localiser.algorithms.timeDelayLocalisers.bearingLoc.AbstractLocaliser<T>
targetMotionOld.TargetMotionLocaliser<T>
- Type Parameters:
 T-
- All Implemented Interfaces:
 LocalisationAlgorithm,LocalisationAlgorithmInfo,PamSettings,SettingsNameProvider
public class TargetMotionLocaliser<T extends GroupDetection>
extends AbstractLocaliser<T>
implements LocalisationAlgorithm, LocalisationAlgorithmInfo, PamSettings
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
 
- 
Nested Class Summary
Nested Classes - 
Field Summary
Fields - 
Constructor Summary
ConstructorsConstructorDescriptionTargetMotionLocaliser(PamControlledUnit pamControlledUnit, PamDataBlock<T> dataBlock, PamDataBlock subDetectionBlock)  - 
Method Summary
Modifier and TypeMethodDescriptionintaddDetectorMenuItems(Frame parentFrame, JMenu menu) voidaddResults(GroupLocResult[] newResults) booleancheckDataLoadTime(T event) voidvoiddataChanged(T pamDetection) Called when data in the main source data block are changedfindEvent(int databaseIndex) Find an event from it's database index.findModelByName(String modelName, boolean shortLength) Find a model by it's name.Get information about the localisation algorithm.Get the algorithm nameintintgetEventMenuItem(T pamDetection) Get a menu item to insert into a pop-up menu for a single event (i.e.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)intGet the likely content flags for this localiser.getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) Get options panel to either build into the export dialog or to show as a separate dialog (in which case export wizard will show a button).Get the algorithm parameters.longGet something that can make LocalisationType objects of a form a bit bespoke to the type of localiser.getTMLocalisation(T event) Get the localisation from an event.voidinterractiveCommand(TargetMotionLocaliser.Interractive interractive) booleanlocaliseDataUnit(T dataUnit) Localise a data unit.voidlocaliseEventList(int[] eventList, TargetMotionModel<T>[] modelList, boolean isSupervised) booleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) runModels(T anEvent, DetectionGroupOptions detectionGroupOptions, TargetMotionModel<T>[] modelList) intselectBestResult(GroupLocResult[] results) Work out which is the best result based on Chi2 and AIC.voidsetBestResultIndex(int bestResultIndex) voidsetCurrentEventIndex(int currentEventIndex, Object sender) booleanshowTMDialog(T dataUnit) Methods inherited from class Localiser.algorithms.timeDelayLocalisers.bearingLoc.AbstractLocaliser
isRunOnAdd, isRunOnUpdate, setRunOnAdd, setRunOnUpdate 
- 
Field Details
- 
currentEventIndex
public int currentEventIndexDatabase index of current event. Not the same as the eventListIndexUse index instead of reference since the data are often reloaded, so references become out of date.
 
 - 
 - 
Constructor Details
- 
TargetMotionLocaliser
public TargetMotionLocaliser(PamControlledUnit pamControlledUnit, PamDataBlock<T> dataBlock, PamDataBlock subDetectionBlock)  
 - 
 - 
Method Details
- 
getLocaliserName
- Specified by:
 getLocaliserNamein classAbstractLocaliser<T extends GroupDetection>- Returns:
 - a name for the localiser for use in dialogs, menus, etc.
 
 - 
getAlgorithmInfo
Description copied from interface:LocalisationAlgorithmGet information about the localisation algorithm.- Specified by:
 getAlgorithmInfoin interfaceLocalisationAlgorithm- Returns:
 - algorithm information.
 
 - 
localiseDataUnit
Description copied from class:AbstractLocaliserLocalise a data unit.Localisation results will be added to the data unit itself in the AbstractLocalisation field.
- Specified by:
 localiseDataUnitin classAbstractLocaliser<T extends GroupDetection>- Parameters:
 dataUnit- data unit to localise- Returns:
 - true if localisation was successful.
 
 - 
getEventMenuItem
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
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 actiondataName- data name to include in the meny text- Returns:
 - menu item or null if action on the detection is not possible
 
 - 
showTMDialog
 - 
addDetectorMenuItems
 - 
checkDataLoadTime
 - 
clearResults
public void clearResults() - 
getResults
 - 
addResults
 - 
getBestResultIndex
public int getBestResultIndex()- Returns:
 - the bestResultIndex
 
 - 
setBestResultIndex
public void setBestResultIndex(int bestResultIndex) - Parameters:
 bestResultIndex- the bestResultIndex to set
 - 
getDataBlock
- Overrides:
 getDataBlockin classAbstractLocaliser<T extends GroupDetection>- Returns:
 - the dataBlock
 
 - 
getModels
 - 
findModelByName
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
Called when data in the main source data block are changed- Parameters:
 pamDetection-
 - 
localiseEventList
public void localiseEventList(int[] eventList, TargetMotionModel<T>[] modelList, boolean isSupervised)  - 
interractiveCommand
 - 
getCurrentEvent
 - 
getCurrentEventIndex
public int getCurrentEventIndex() - 
setCurrentEventIndex
 - 
runModels
public GroupLocResult[] runModels(T anEvent, DetectionGroupOptions detectionGroupOptions, TargetMotionModel<T>[] modelList)  - 
findEvent
Find an event from it's database index.- Parameters:
 databaseIndex-
 - 
selectBestResult
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
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
public int getLocalisationContents()Description copied from interface:LocalisationAlgorithmInfoGet the likely content flags for this localiser.- Specified by:
 getLocalisationContentsin interfaceLocalisationAlgorithmInfo- Returns:
 - localisation flags.
 - See Also:
 
 - 
getAlgorithmName
Description copied from interface:LocalisationAlgorithmInfoGet the algorithm name- Specified by:
 getAlgorithmNamein interfaceLocalisationAlgorithmInfo- Returns:
 - algorithm name
 
 - 
getTethysCreator
Description copied from interface:LocalisationAlgorithmGet 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:
 getTethysCreatorin interfaceLocalisationAlgorithm- Returns:
 - can be null in which case standard functions will do the best they can.
 
 - 
getParameters
Description copied from interface:LocalisationAlgorithmInfoGet the algorithm parameters. Something else can turn these into xml for Tethys.- Specified by:
 getParametersin interfaceLocalisationAlgorithmInfo- Returns:
 - algorithm parameters object. Might be null;
 
 - 
getLocalizationOptionsPanel
public LocalizationOptionsPanel getLocalizationOptionsPanel(Window parent, LocalizationBuilder locBuilder) Description copied from interface:LocalisationAlgorithmInfoGet options panel to either build into the export dialog or to show as a separate dialog (in which case export wizard will show a button). Can be null if no options.- Specified by:
 getLocalizationOptionsPanelin interfaceLocalisationAlgorithmInfo- Parameters:
 locBuilder-- Returns:
 - options panel or null if there are no options.
 
 - 
getUnitName
- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- Returns:
 - true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
 
 - 
getTargetMotionOptions
- Returns:
 - the targetMotionOptions
 
 
 -