鱼C论坛

 找回密码
 立即注册
查看: 1849|回复: 1

把network做成parameter

[复制链接]
发表于 2021-4-13 22:07:09 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
The current simulation create a 2-d grid network. We want to be able to use other types of
networks, and we want to pass these networks as parameters. We also want to pass the
number of nodes as a parameter to the init() function, and we want to pass another
parameter (call it netParam). This is a network specific parameter. For Erdos-Renyi, it is
the probability of connection p, for Barabasi-Albeter it is the number of edges a new node
has m. The init() function line should look something like:
def init(network, nb_agents, netParam, probInfectionInit):
You need to make necessary changes in the code inside init() function. Test your
simulation again (passing a ER network with p=0.1). For the sake of this testing alone,
you can add default values for your parameters in init() like:
def init(network =nx.erdos_renyi_graph, nb_agents, netParam=.1, probInfectionInit):


大意就是网络里的点当作一个parameter,应该怎么写呢
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2021-4-14 08:50:31 | 显示全部楼层
英文不好,能翻译一下?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-1-16 02:52

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表