本文整理汇总了Python中Simulator.Simulator.add_survival_curve方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.add_survival_curve方法的具体用法?Python Simulator.add_survival_curve怎么用?Python Simulator.add_survival_curve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulator.Simulator
的用法示例。
在下文中一共展示了Simulator.add_survival_curve方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Simulator
# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import add_survival_curve [as 别名]
from Simulator import Simulator
from States import S_Start, S_DeadCancer, S_DeadAge, S_DeadChemo
from numpy import average
import ConundrumModel as Model
s= Simulator(iters=10000, age=60, ca125=True, model=Model)
s.run()
print average([len(p.states) for p in s.patients])
s.clear_survival_curves()
s.add_survival_curve(start_states=[S_Start],
end_states=[S_DeadCancer])
s.add_survival_curve(start_states=[S_Start],
end_states=[S_DeadChemo])
s.add_survival_curve(start_states=[S_Start],
end_states=[S_DeadAge])
s.draw_survival_curves(name="conundrum.png")
示例2: Simulator
# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import add_survival_curve [as 别名]
from Simulator import Simulator
from States import S_Start, S_DeadAge
import HW1_model as Model
for time_increment in [1.0, 1./12, 1./52, 1./365]:
s= Simulator(iters=5000, age=60, model=Model, time_increment = 1.0 / 52)
s.run()
s.clear_survival_curves()
s.add_survival_curve(start_states=[S_Start],
end_states=[S_DeadAge])
s.draw_survival_curves(name="Survival_HW_1.%s"%time_increment)