本文整理汇总了Python中context.Context.connect方法的典型用法代码示例。如果您正苦于以下问题:Python Context.connect方法的具体用法?Python Context.connect怎么用?Python Context.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类context.Context
的用法示例。
在下文中一共展示了Context.connect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import connect [as 别名]
'$parent() == other.parent()')
# send output to sum
s.add_rule('outgoing',
'other.name == "sum"',
"$parent() == other.parent()")
# Re-initialize entire circuit
s.init_simulation()
# make connections between necessary populations
# connect stim_points to biphasics
s.connect(['$name == "stimulus"'],
['$name == "BCM"'])
# connect biphasics to sums
s.connect(['$name == "biphasic"'],
['$name == "sum"'])
# connect thresh to feedback ..better way of doing both this and next one?
s.connect(['$name == "thresh"'],
['$name == "feedback"'])
# connect feedback to sums
s.connect(['$name == "feedback"'],
['$name == "sum"'])
# connect sums to thresh
s.connect(['$name == "sum"'],
示例2:
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import connect [as 别名]
s.add_rule('outgoing',
'other.name == "sum"',
"$parent() == other.parent()")
# Re-initialize entire circuit
# really need to do before and after connection?...
s.init_simulation()
# make connections between necessary populations
# connect stim_points to biphasics
#s.connect(['$name == "stimulus"'],
# ['$name == "BCM"'])
s.connect(['$name == "stim_point"'],
['$name == "biphasic"'])
# connect biphasics to sums
s.connect(['$name == "biphasic"'],
['$name == "sum"'])
# connect thresh to feedback ..better way of doing both this and next one?
s.connect(['$name == "thresh"'],
['$name == "feedback"'])
# connect feedback to sums
s.connect(['$name == "feedback"'],
['$name == "sum"'])
# connect sums to thresh
s.connect(['$name == "sum"'],
示例3:
# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import connect [as 别名]
s.parse_rule(DoG_hump('$g_grid', g_irf, g_ia, g_c))
#s.copy_node(N=1)
# Re-initialize entire circuit
# really need to do before and after connection?...
s.init_simulation()
# make connections between necessary populations
# connect photoreceptor to horizontal
s.connect(['$name == "photoreceptor"'],
['$name == "horizontal"'])
# connect photoreceptor to bipolar
s.connect(['$name == "photoreceptor"'],
['$name == "bipolar"'])
# connect horizontal to bipolar
s.connect(['$name == "horizontal"'],
['$name == "bipolar"'])
# connect bipolar to amacrine
s.connect(['$name == "bipolar"'],
['$name == "amacrine"'])
# connect bipolar to ganglion
s.connect(['$name == "bipolar"'],