我试图让所有补丁都有红点距离信息[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]
答案 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 ]