def run(self): self.auiframe.lastpoints = processtool.generate_clusteredpoints(self.auiframe.dataFilePath, self.auiframe.clusterType, self.auiframe.datafileMultiplyIndex, self.auiframe.iterationRecords) dc = wx.ClientDC(self.auiframe.backgroundPanel) dc.SetPen(wx.Pen("RED")) dc.SetBrush(wx.Brush("RED")) for point in self.auiframe.lastpoints: colortype = point.type if point.type != cluster.DBSCAN_NOISETYPE else -1 if self.auiframe.datafileMultiplyIndex == 1: colortype = point.type if point.type<=9 else -1 dc.SetPen(wx.Pen(colors[colortype])) dc.SetBrush(wx.Brush(colors[colortype])) dc.DrawCircle(point.coordinates[0]*multiplyBy[self.auiframe.datafileMultiplyIndex], \ backgroundHeight-point.coordinates[1]*multiplyBy[self.auiframe.datafileMultiplyIndex], pointSize[self.auiframe.datafileMultiplyIndex]) self.auiframe.iterationNum = -1 self.auiframe.helpStaticText2.SetLabelText('Iteration times : '+str(len(self.auiframe.iterationRecords)-1)+'\nNow: '+str(len(self.auiframe.iterationRecords)-1)) self.ano.Destroy()
def dbscanTest(): points = processtool.generate_clusteredpoints("./Aggregation.txt", "dbscan") print len(points)