本文整理匯總了Python中exp.viroscopy.model.HIVGraph.HIVGraph.save方法的典型用法代碼示例。如果您正苦於以下問題:Python HIVGraph.save方法的具體用法?Python HIVGraph.save怎麽用?Python HIVGraph.save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類exp.viroscopy.model.HIVGraph.HIVGraph
的用法示例。
在下文中一共展示了HIVGraph.save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: range
# 需要導入模塊: from exp.viroscopy.model.HIVGraph import HIVGraph [as 別名]
# 或者: from exp.viroscopy.model.HIVGraph.HIVGraph import save [as 別名]
theta, sigmaTheta = HIVModelUtils.toyTheta()
graphList = []
for j in range(numRepetitions):
graph = HIVGraph(M, undirected)
logging.debug("Created graph: " + str(graph))
alpha = 2
zeroVal = 0.9
p = Util.powerLawProbs(alpha, zeroVal)
hiddenDegSeq = Util.randomChoice(p, graph.getNumVertices())
rates = HIVRates(graph, hiddenDegSeq)
model = HIVEpidemicModel(graph, rates)
model.setT(endDate)
model.setRecordStep(recordStep)
model.setParams(theta)
logging.debug("Theta = " + str(theta))
times, infectedIndices, removedIndices, graph = model.simulate(True)
print(times)
graphFileName = outputDir + "ToyEpidemicGraph" + str(j)
graph.save(graphFileName)
graphList.append(graph)
logging.debug("All done. ")