二章
书迷正在阅读:神秘礼盒[短篇集] , 王者学院的超级大乱炖 , 《摘星》 , 我要带你逃往余晖 , 糖突(GL) , 致洋贞—傀儡公主与微笑王子 , 【2025】POPO原赏耽美百合组 , 千重妖镜 , 偏爱(纯百短篇) , 九十天的恋爱 , 《你化妆起来很美》 , 《风尘骄子·暗行录》
ndom importstatistics defsimute_spreadpop_size=1000,initial_seed=5,i_prob=0.03,resist_prob=0.1,steps=50: #状态:0=未接触,1=接触但未采纳,2=采纳「感染」 popution=[0]*pop_size #随机设置初始采纳者seed foriinrandom.samplerangepop_size,initial_seed: popution[=2 history=[] forstepinraeps: new_popution=popution.copy foriinrangepop_size: ifpopution[==2: #试着影响k随机接触者 tacts=random.samplerangepop_size,k=5 fortacts: ifpopution[c]==0: ifrandom.random #接触後有机会直接采纳 new_popution[c]=2 1 else: #有机会是只是「接触但未采纳」 new_popution[c]=1 elifpopution[c]==1: #已接触过但犹豫的人,再次接触有机