本文整理匯總了Python中exp.viroscopy.model.HIVGraph.HIVGraph.detectedNeighbours方法的典型用法代碼示例。如果您正苦於以下問題:Python HIVGraph.detectedNeighbours方法的具體用法?Python HIVGraph.detectedNeighbours怎麽用?Python HIVGraph.detectedNeighbours使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類exp.viroscopy.model.HIVGraph.HIVGraph
的用法示例。
在下文中一共展示了HIVGraph.detectedNeighbours方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testDetectedNeighbours
# 需要導入模塊: from exp.viroscopy.model.HIVGraph import HIVGraph [as 別名]
# 或者: from exp.viroscopy.model.HIVGraph.HIVGraph import detectedNeighbours [as 別名]
def testDetectedNeighbours(self):
numVertices = 10
graph = HIVGraph(numVertices)
self.assertTrue(graph.getRemovedSet() == set([]))
graph.getVertexList().setInfected(1, 0.0)
graph.getVertexList().setInfected(2, 0.0)
graph.getVertexList().setInfected(7, 0.0)
graph.getVertexList().setDetected(1, 0.0, HIVVertices.randomDetect)
graph.getVertexList().setDetected(2, 0.0, HIVVertices.randomDetect)
graph.getVertexList().setDetected(7, 0.0, HIVVertices.randomDetect)
graph[0, 1] = 1
graph[0, 2] = 1
graph[0, 3] = 1
graph[0, 4] = 1
self.assertTrue((graph.detectedNeighbours(0) == numpy.array([1, 2])).all())
graph.getVertexList().setInfected(3, 0.0)
graph.getVertexList().setDetected(3, 0.0, HIVVertices.randomDetect)
self.assertTrue((graph.detectedNeighbours(0) == numpy.array([1, 2, 3])).all())