当前位置: 首页>>代码示例>>Python>>正文


Python Context.connect方法代码示例

本文整理汇总了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"'], 
开发者ID:abjose,项目名称:surfsim3,代码行数:34,代码来源:old_tests.py

示例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"'], 
开发者ID:abjose,项目名称:surfsim2,代码行数:34,代码来源:tests.py

示例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"'], 
开发者ID:abjose,项目名称:surfsim2,代码行数:34,代码来源:tests2.py


注:本文中的context.Context.connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。