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


Python Pattern.interface[m2_int_sel_in]方法代码示例

本文整理汇总了Python中pattern.Pattern.interface[m2_int_sel_in]方法的典型用法代码示例。如果您正苦于以下问题:Python Pattern.interface[m2_int_sel_in]方法的具体用法?Python Pattern.interface[m2_int_sel_in]怎么用?Python Pattern.interface[m2_int_sel_in]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pattern.Pattern的用法示例。


在下文中一共展示了Pattern.interface[m2_int_sel_in]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: MyModule

# 需要导入模块: from pattern import Pattern [as 别名]
# 或者: from pattern.Pattern import interface[m2_int_sel_in] [as 别名]
                  man.port_data, man.port_ctrl, man.port_time, 'm2   ', False,
                  True)
    man.add_mod(m2)
    m3 = MyModule(m3_int_sel, m3_int_sel_in, m3_int_sel_out,
                  np.zeros(4, dtype=np.float),
                  ['interface', 'io', 'type'], 
                  man.port_data, man.port_ctrl, man.port_time, 'm3   ', False,
                  True)
    man.add_mod(m3)

    # Make sure that all ports in the patterns' interfaces are set so 
    # that they match those of the modules:
    pat12 = Pattern(m1_int_sel, m2_int_sel)
    pat12.interface[m1_int_sel_out] = [0, 'in']
    pat12.interface[m1_int_sel_in] = [0, 'out']
    pat12.interface[m2_int_sel_in] = [1, 'out']
    pat12.interface[m2_int_sel_out] = [1, 'in']
    pat12['/a[2]', '/b[0]'] = 1
    pat12['/a[3]', '/b[1]'] = 1
    pat12['/b[3]', '/a[0]'] = 1
    man.connect(m1, m2, pat12, 0, 1)

    pat23 = Pattern(m2_int_sel, m3_int_sel)
    pat23.interface[m2_int_sel_out] = [0, 'in']
    pat23.interface[m2_int_sel_in] = [0, 'out']
    pat23.interface[m3_int_sel_in] = [1, 'out']
    pat23.interface[m3_int_sel_out] = [1, 'in']
    pat23['/b[4]', '/c[0]'] = 1
    pat23['/c[2]', '/b[2]'] = 1
    man.connect(m2, m3, pat23, 0, 1)
开发者ID:MariyaS,项目名称:neurokernel,代码行数:32,代码来源:base.py


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