From 814d68f0a837e30279ab310582e8fce5877bac8d Mon Sep 17 00:00:00 2001 From: Erik Liland Date: Wed, 10 May 2017 09:26:32 +0200 Subject: [PATCH 1/5] Added kwargs conflict handling --- pymht/tracker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymht/tracker.py b/pymht/tracker.py index 1ebca908..e606c05f 100644 --- a/pymht/tracker.py +++ b/pymht/tracker.py @@ -1076,7 +1076,8 @@ def plotActiveTracks(self, **kwargs): def plotTerminatedTracks(self, **kwargs): colors = kwargs.get("colors", self._getColorCycle()) for track in self.__terminatedTargets__: - track.plotTrack(c=next(colors), markInitial=True, markEnd=True, terminated = True, **kwargs) + defaults = {'c':next(colors), 'markInitial': True, 'markEnd': True, 'terminated': True} + track.plotTrack(**{**defaults,**kwargs}) if kwargs.get('markStates', False): defaults = {'labels': False, 'dummy': True, 'real': True, 'ais': True} track.plotStates(float('inf'), **{**defaults, **kwargs}) From 2c186705b77139d021e03ccf5ed12d72be0320d8 Mon Sep 17 00:00:00 2001 From: Erik Liland Date: Thu, 11 May 2017 12:34:50 +0200 Subject: [PATCH 2/5] Fixed bug that would store the number of sim states as true track length in stead of the number of radar samples --- pymht/utils/classDefinitions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymht/utils/classDefinitions.py b/pymht/utils/classDefinitions.py index 9c8790ae..4ec41a64 100644 --- a/pymht/utils/classDefinitions.py +++ b/pymht/utils/classDefinitions.py @@ -186,12 +186,14 @@ def storeGroundTruth(self, scenarioElement, scenario, **kwargs): attrib={idTag:str(i)}) statesElement = ET.SubElement(trackElement, statesTag) + sampleCounter = 0 for j in range(nSamples): simTarget = self[j][i] inRange = simTarget.inRange(p0, radarRange) radarTime = ((simTarget.time-initialTime)%radarPeriod) == 0. if (not inRange) or (not radarTime): continue + sampleCounter += 1 stateElement = ET.SubElement(statesElement, stateTag, attrib={timeTag:str(simTarget.time), @@ -208,7 +210,7 @@ def storeGroundTruth(self, scenarioElement, scenario, **kwargs): trackElement.attrib[aisclassTag] = str(simTarget.aisClass) trackElement.attrib[prTag] = str(simTarget.P_r) statesElement.attrib[sigmaqTag] = str(simTarget.sigma_Q) - trackElement.attrib[lengthTag] = str(j+1) + trackElement.attrib[lengthTag] = str(sampleCounter) From 0d58b34106aad5e7d6af9516997dcc663373b05b Mon Sep 17 00:00:00 2001 From: Erik Liland Date: Thu, 11 May 2017 14:46:54 +0200 Subject: [PATCH 3/5] Changes storeNodesSparse to only store first and last state --- pymht/pyTarget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymht/pyTarget.py b/pymht/pyTarget.py index 5fffdeb3..77e69362 100644 --- a/pymht/pyTarget.py +++ b/pymht/pyTarget.py @@ -781,7 +781,8 @@ def _storeNodeSparse(self, simulationElement, **kwargs): unSmoothedNodes = self.backtrackNodes() - for node in unSmoothedNodes: + storeIndices = (0, -1) if len(unSmoothedNodes) > 1 else (0,) + for node in [unSmoothedNodes[i] for i in storeIndices]: stateElement = ET.SubElement(unSmoothedStates, stateTag, attrib={timeTag: str(node.time)}) From 30f5264c50a757de2e2c7493c42edc7ee7bf32d7 Mon Sep 17 00:00:00 2001 From: Erik Liland Date: Sat, 13 May 2017 10:28:43 +0200 Subject: [PATCH 4/5] Added hint to further development --- pymht/initiators/m_of_n.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pymht/initiators/m_of_n.py b/pymht/initiators/m_of_n.py index 9c2fbccf..6aef70b3 100644 --- a/pymht/initiators/m_of_n.py +++ b/pymht/initiators/m_of_n.py @@ -6,6 +6,7 @@ from scipy.stats import chi2 import logging import time +# import scipy.optimize.linear_sum_assignment tracking_parameters = { 'gate_probability': 0.99, From 5042d47071193e21b3c7bc8bca8c572001157c30 Mon Sep 17 00:00:00 2001 From: Erik Liland Date: Sat, 13 May 2017 10:28:55 +0200 Subject: [PATCH 5/5] Added timeLog tags --- pymht/utils/xmlDefinitions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pymht/utils/xmlDefinitions.py b/pymht/utils/xmlDefinitions.py index bcab7dd9..7e14d63b 100644 --- a/pymht/utils/xmlDefinitions.py +++ b/pymht/utils/xmlDefinitions.py @@ -60,4 +60,14 @@ inverseResidualCovarianceTag = "S_inv" terminatedTag = "terminated" +totalTimeTag = "Total" +initTimeTag = "Init" +clusterTimeTag = "Cluster" +dynamicWindowTimeTag = "DynN" +optimizationTimeTag = "Optim" +npruneTimeTag = "N-prune" +growingTimeTag = "Process" +ilpPruneTimeTag = "ILP-Prune" +terminateTimeTag = "Terminate" + timeLogPrecision = 6 \ No newline at end of file