本文整理汇总了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. ")