Skip to content

Commit

Permalink
Merge pull request #14 from erikliland/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
erikliland authored May 13, 2017
2 parents 5375d57 + 5042d47 commit da7214b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions pymht/initiators/m_of_n.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion pymht/pyTarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
3 changes: 2 additions & 1 deletion pymht/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 3 additions & 1 deletion pymht/utils/classDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)



Expand Down
10 changes: 10 additions & 0 deletions pymht/utils/xmlDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit da7214b

Please sign in to comment.