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


Python Context.set_focus方法代码示例

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


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

示例1: Grid

# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import set_focus [as 别名]
# add stimulus sizes to root node...would be nicer if they went in stimulus node
s.add_rule('init',
           '$kernel_length = 10',
           '$output_length = 50',
           '$bcm_radius = 4.',
           '$stim_size  = 20',
           '$max_delay  = 3')
           # add all grids here? just name differently...
# NOTE: these are one longer than you think - fix?



# add a container for stimulus and 'focus' on it
s.add_node('$name = "stimulus"')
s.set_focus('$name == "stimulus"')

# add a distribution rule for stimulus points
s.add_rule('init',
           # dx and dy were initially 2 for both of these, changing temporarily
           '$stim_grid = Grid(xl=$stim_size, yl=$stim_size, dx=1, dy=1)',
           # should just reset stim_grid instead of copying?
           '$bph_grid  = Grid(xl=$stim_size, yl=$stim_size, dx=1, dy=1)')
           #'print $stim_grid.positions')

# also maintain a matrix of stimulus values for stimulus points to access
s.add_rule('init',
           #'$stim = SinusoidStim($stim_size, $stim_size)', # why two?
           #'$stim = JigglySinusoidStim($stim_size, 10)',
           #'$stim = InvertingSinusoidStim($stim_size, 20)',
           #'$stim = SquareWaveStim($stim_size, 8)',
开发者ID:abjose,项目名称:surfsim2,代码行数:32,代码来源:tests.py

示例2: JigglySinusoidStim

# 需要导入模块: from context import Context [as 别名]
# 或者: from context.Context import set_focus [as 别名]
           #'$stim = JigglySinusoidStim($stim_size, 10)',
           #'$stim = InvertingSinusoidStim($stim_size, 20)',
           #'$stim = SquareWaveStim($stim_size, 8)',
           #'$stim = BarStim($stim_size, 10)',
           '$stim = FullFieldStim($stim_size, 20)',
           '$stim.step()', 
           '$stim_data = $stim.output')
s.add_rule('update',
           '$stim.step()', 
           '$stim_data = $stim.output')



# add photoreceptors (don't specify connections?)
s.add_node('$name = "p_layer"')
s.set_focus('$name == "p_layer"')
s.add_node('$name = "photoreceptor"')
s.set_focus('$name == "photoreceptor"')

# read from associated position in stimulus matrix
s.add_rule('init', 
           '$x, $y = $stim_grid.get_next()',
           '$init_data($output_length)')
s.add_rule('interact',
           '$temp_data = $stim_data[$x][$y]')
s.add_rule('update',
           '$append_data($temp_data)',
           '$clean_data($output_length)')

# ADD APPROPRIATE IRF!!
开发者ID:abjose,项目名称:surfsim2,代码行数:32,代码来源:tests2.py


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