def inducedEdge(sampleList, friendList, breakDep, theta) : print "+++Induced Edge+++" noDependList = [] noDependFriendList = [] if breakDep == 0 : noDependList = depend.thinningsample(sampleList, theta,0) noDependFriendList = depend.thinningfriend(friendList, theta,0) print "***Simple Thinning***" print "Estimated Size of nodes :" + str(getListResult(noDependList, noDependFriendList)) print "Induced Edges :" + str(inducedEdgeNum) elif breakDep == 1 : totalNodeSize = 0 for i in range(0,theta-1) : noDependList = depend.thinningsample(sampleList,theta,i) noDependFriendList = depend.thinningfriend(friendList, theta,0) totalNodeSize = totalNodeSize + getListResult(noDependList, noDependFriendList) print "Induced Edges :" + str(inducedEdgeNum) print "***Shift Thinning***" print "Estimated Size of nodes :" + str(int(totalNodeSize/theta)) elif breakDep == 2 : print "***Safety Margin***" print "Estimated Size of nodes :" + str(int(safetymarginIE(sampleList, friendList, theta))) else : print "Error in breaking dependence type!"
def collisionCount(sampleList,breakDep,theta) : print "+++Collision Counting+++" noDependList = [] if breakDep == 0 : noDependList = depend.thinningsample(sampleList,theta,0) #print noDependList[3][1] print "***Simple Thinning***" print "Estimated Size of nodes :" + str(getListResult(noDependList)) elif breakDep == 1 : totalNodeSize = 0 for i in range(0,theta-1) : noDependList = depend.thinningsample(sampleList,theta,i) totalNodeSize = totalNodeSize + getListResult(noDependList) print "***Shift Thinning***" print "Estimated Size of nodes :" + str(int(totalNodeSize/theta)) elif breakDep == 2 : print "***SaftyMargin***" print "Estimated Size of nodes :" + str(int(safetyMargin(sampleList,theta))) else : print "Error in breaking dependence type!"