-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodeCluster
More file actions
27 lines (16 loc) · 703 Bytes
/
Copy pathnodeCluster
File metadata and controls
27 lines (16 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import numpy as np
class nodeCluster(object):
listSample=[]
def __init__(self, indexCurrentNode, listSample):
self.listSample = listSample
self.indexCurrentNode = indexCurrentNode
def setNodesSample(self, listSample):
self.listSample = listSample
def setNode(self, indexCurrentNode):
self.indexCurrentNode = indexCurrentNode
def getTempNeighbor(self, D, eps):
neighborTempList=[]
for i in range(len(self.listSample)):
if np.linalg.norm(np.subtract(D[[self.indexCurrentNode],], D[[self.listSample[i]],])) <= eps:
neighborTempList.append(self.listSample[i])
return neighborTempList