在NetLogo中,我可以要求代理人从中心补丁中逐渐消失吗?

时间:2016-06-16 10:12:52

标签: netlogo

在我的模型中,我让代理人在整个环境中随机发芽。我想要这些药剂的密度梯度。

是否有更简洁的方法来执行此操作而不是针对不同的半径执行此类操作?:

ask patch 0 0 [ask n-of 20 turtles in-radius 20 [die]]

谢谢

1 个答案:

答案 0 :(得分:2)

你可以沿着这些方向做点什么:

tf.identity(var.ref())

许多变种都是可能的。关键是使用assign_op = tf.assign(_x, x).op with tf.control_dependencies([assign_op]): # Read updated value of `_x` after `assign_op`. new_perm = tf.gather(tf.identity(_x.ref()), i) permute_op = tf.assign(_x, new_perm).op sess.run(permute_op) # Runs both assignments. to setup clear-all let max-distance max [ distancexy 0 0 ] of patches ask patches [ if random-float 1.0 > (distancexy 0 0 / max-distance) [ sprout 1 ] ] end 的组合来获得您想要的密度。