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
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
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTargetMotionLocaliser
(PamControlledUnit pamControlledUnit, PamDataBlock<T> dataBlock, PamDataBlock subDetectionBlock) -
Method Summary
Modifier and TypeMethodDescriptionint
addDetectorMenuItems
(Frame parentFrame, JMenu menu) void
addResults
(GroupLocResult[] newResults) boolean
checkDataLoadTime
(T event) void
void
dataChanged
(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 nameint
int
getEventMenuItem
(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)int
Get the likely content flags for this localiser.Get the algorithm parameters.Get 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.void
interractiveCommand
(TargetMotionLocaliser.Interractive interractive) boolean
localiseDataUnit
(T dataUnit) Localise a data unit.void
localiseEventList
(int[] eventList, TargetMotionModel<T>[] modelList, boolean isSupervised) runModels
(T anEvent, DetectionGroupOptions detectionGroupOptions, TargetMotionModel<T>[] modelList) int
selectBestResult
(GroupLocResult[] results) Work out which is the best result based on Chi2 and AIC.void
setBestResultIndex
(int bestResultIndex) void
setCurrentEventIndex
(int currentEventIndex, Object sender) boolean
showTMDialog
(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:
getLocaliserName
in classAbstractLocaliser<T extends GroupDetection>
- Returns:
- a name for the localiser for use in dialogs, menus, etc.
-
getAlgorithmInfo
Description copied from interface:LocalisationAlgorithm
Get information about the localisation algorithm.- Specified by:
getAlgorithmInfo
in interfaceLocalisationAlgorithm
- Returns:
- algorithm information.
-
localiseDataUnit
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 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:
getDataBlock
in 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:LocalisationAlgorithmInfo
Get the likely content flags for this localiser.- Specified by:
getLocalisationContents
in interfaceLocalisationAlgorithmInfo
- Returns:
- localisation flags.
- See Also:
-
getAlgorithmName
Description copied from interface:LocalisationAlgorithmInfo
Get the algorithm name- Specified by:
getAlgorithmName
in interfaceLocalisationAlgorithmInfo
- Returns:
- algorithm name
-
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 interfaceLocalisationAlgorithm
- Returns:
- can be null in which case standard functions will do the best they can.
-
getParameters
Description copied from interface:LocalisationAlgorithmInfo
Get the algorithm parameters. Something else can turn these into xml for Tethys.- Specified by:
getParameters
in interfaceLocalisationAlgorithmInfo
- Returns:
- algorithm parameters object. Might be null;
-