如何在Netlogo的泛型函数中将具有特定属性的品种作为参数传递?

问题描述

下面的代码显示了带有几个参数的函数,其中一些是品种名称,例如#asking-species,为了将一个品种作为参数传递,我像这样使用let breed-here turtles-here with [breed = #species2]

to bwd-reaction2 [ #asking-species #species2 #x-k_off #new-breed x-occupiedepitopes x-size x-exempt_from_immobilisation x-aggregated x-color #hatching-species x-occupiedepitopes2 x-size2 x-exempt_from_immobilisation2 x-aggregated2]
  
  let breed-here turtles-here with [breed = #species2]
  ask #asking-species [ 
    if (any? other breed-here) and random-float 1000 < (#x-k_off)
    [
      set breed #new-breed    ;; change back to reactant
      set-attributes2 x-occupiedepitopes x-size x-exempt_from_immobilisation x-aggregated x-color
      ;; then split into two reactants
      hatch-#hatching-species 1
      [
        set-attributes x-occupiedepitopes2 x-size2 x-exempt_from_immobilisation2 x-aggregated2
      ]
      
    ]
  ]
end

但是要更改以下功能,使其接受具有特定属性的品种 作为参数,我应该如何更改代码

例如,我想要:ask #asking-species with [ aggregated = false ]

不仅仅是ask #asking-species

作为论点之一?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)