diff --git a/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTClickTrainAlgorithm.java b/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTClickTrainAlgorithm.java index 66fdabe3..7f50025e 100644 --- a/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTClickTrainAlgorithm.java +++ b/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTClickTrainAlgorithm.java @@ -354,6 +354,7 @@ public class MHTClickTrainAlgorithm implements ClickTrainAlgorithm, PamSettings TrackBitSet trackBitSet; TrackDataUnits trackUnits; if (nTracks>0) Debug.out.println("-------------------Grab Done Trains---------------"); + try { for (int i =0; i0) Debug.out.println("-------------------------------------------------"); diff --git a/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTKernel.java b/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTKernel.java index 3a4fb0ee..4fa9cdfb 100644 --- a/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTKernel.java +++ b/src/clickTrainDetector/clickTrainAlgorithms/mht/MHTKernel.java @@ -3,6 +3,7 @@ package clickTrainDetector.clickTrainAlgorithms.mht; import java.util.ArrayList; import java.util.BitSet; import java.util.Collections; +import java.util.Comparator; import PamUtils.PamArrayUtils; import PamguardMVC.debug.Debug; @@ -286,6 +287,7 @@ public class MHTKernel { MHTChi2 mhtChi2; int index; synchronized(trackSynchronisation) { + try { for (int i=0; i { //added the cloned bitset to not mess up references newPossibilities.add(new TrackBitSet(currentBitSet, mhtChi2)); } + } + catch (Exception e) { + System.out.printf("******* MHTKernel Exception %s in growProbMatrix: %s\n", e.getClass().getSimpleName(), e.getMessage()); + } } } @@ -348,10 +354,21 @@ public class MHTKernel { //first sort the tracks by increasing chi2 values. //sort the possible tracks by chi2 values //now sort the chi2 values so they correspond to the track list. - Collections.sort(newPossibleTracks, (left, right)->{ - //Note- this is definitely in the correct order - return Double.compare(left.chi2Track.getChi2(), right.chi2Track.getChi2()); - }); +// Collections.sort(newPossibleTracks, (left, right)->{ +// //Note- this is definitely in the correct order +// return Double.compare(left.chi2Track.getChi2(), right.chi2Track.getChi2()); +// }); + try { + Collections.sort(newPossibleTracks, new Comparator() { + @Override + public int compare(TrackBitSet left, TrackBitSet right) { + return Double.compare(left.chi2Track.getChi2(), right.chi2Track.getChi2()); + } + }); + } + catch (Exception e) { + System.out.printf("******* MHTKernel Exception %s in pruneProbMatrix: %s\n", e.getClass().getSimpleName(), e.getMessage()); + } // for (int i=0; i