Netlogo:如何使补丁具有来自某个红色补丁的距离信息

时间:2016-06-23 22:08:24

标签: netlogo

我试图让所有补丁都有红点距离信息[5 -5]。然后这些距离信息将最终用于观察动态。

% Just use grayscale for the base
hbase = ind2rgb(gray2ind(base), gray);

% Have the temperature use the builtin colormap 
hold on
htemp = imshow(temp, [-2,2]);
colormap jet

我添加了电子距离以插入距离信息

 patches-own [e-distance]

1 个答案:

答案 0 :(得分:1)

使用distance

ask patches [ set e-distance distance red-patch]

在此之前确保您的red-patch是代理(不是代理集)。使用let

更改one-of
let red-patch one-of patches with [ pcolor = red ]