使用max-one-of或min-one-of报告器找出在一定范围内哪个代理最多或最少。例如,要移除最富有的海龟,您可以说 ask max-one-of turtles [sum assets] [ die ] histogram使用命令(结合)制作代理集的直方图of。 用于of制作一个值列表,一个值对应代理集中的每个代理。然后使用 NetLogo 的列表原语之一对列表进行操作。
Netlogo Rnd扩展:通过输入框加载概率权重 我想从这个列表中随机报告一个项目: set probability-list [["residential" 0.60] ["commercial" 0.30] ["industrial" 0.10]] 它们的命名方式是: set land-use first rnd:weighted-one-of-list probability-list last 但我希望每个项目的权重由用户通过模型界面中的输入...
[ let winner min-one-of neighbors [temp] ifelse [temp] of winner < temp [ report winner ] [ report patch-here ] ] end to bug-move [target] ;; turtle procedure ;; if we're already there, there's nothing to do if target = patch-here [ stop ] ;; move to the target patch (...
gis:shape-type-ofgis:property-namesgis:feature-list-ofgis:vertex-lists-ofgis:centroid-ofgis:random-point-insidegis:location-ofgis:set-property-valuegis:property-valuegis:find-featuresgis:find-one-featuregis:find-less-thangis:find-greater-thangis:find-rangegis:property-minimumgis:property-maximumgis...
这是移动代码 ask customers[ set num-traders-close count traders with [distance myself < 10] set closest-trader distance min-one-of traders [dista 浏览0提问于2013-12-17得票数 1 1回答 netlogo海龟在坐标上移动 、、 我创造了一种叫做“鸟”的乌龟,它们会沿着特定的路线移动。这条路线是由乌龟...
doc: Typo in documentation of max-pzcor min-pzcor (#224) enhancement: Windows: upgrade Install4J to 5.0.11 (#60) enhancement: controlling API: ExtensionManager should allow access to loaded extensions (#209) models: Oil Cartel: re-enable narrowcast plotting & fix client plot (#204) ...
, with-min, with-max, min-one-of, max-one-of, min-n-of, max-n-of。说简单点,self就是自己,myself就是请求我做事的人,举个例子:ask turtles [show self ask patches in-radius 2 [set pcolor [ color ] of myself show self show myself ]]第一个self,在ask turtles 范围里,所以指的...
Now let's kill one turtle: ask one-of turtles [ die ] show map sort nw:get-context As expected, the context is updated to reflect the death of the turtle and of the two links that died with it: [[(turtle0) (turtle1)] [(link01)]] ...
模型原理:模型模拟了财富分配,我们通常说“穷的人变的更穷,富的人会越来越富”,这就表达了财富分配的不均匀。模型模拟了帕雷托法则(pareto’s law)。模型中大量的穷人用红色标记,中等阶级用绿色标记,少量的富人用蓝色标记。穷人富人的视野不一样(这里可以理解为生活中能够获得的资源不一样),这就决定了...
letcar-ahead one-of turtles-on patch-ahead 1 ifelsecar-ahead != nobody [ slow-down-car car-ahead ] [ speed-up-car ] ifspeed < speed-min [ set speed speed-min ] ifspeed > speed-limit [ set speed speed-limit ] fdspeed ]