|
|
新手发问超简单问题,目前还处于研读范例码的阶段,边测边看结果来理解程序
1 r0 i9 J/ }( `2 ^其中有一段如下
$ W. Y* a, P) `; cask turtles with [ infected? = true ]
) m" e O: f( h3 R我原本以为这句会回传『所有』infected? = true 的 turtle) n3 F# w8 {4 }* j- S
但看结果似乎不是这样。 M; l9 M& L0 j' A; G0 j8 ~7 ]4 V
2 m- r9 `8 ?, ^2 X" X
假设所有符合条件的有 5 笔! A' W* o7 G2 b1 ^
有时候回传 1 笔,有时回传 3 笔,是不固定的
) ]$ G1 f8 o* \7 V. t' T$ x回头查语法定义
, o/ _- A8 ]6 \& P9 h- l9 m- gwith " |, S8 k$ e# W/ G: @1 W
agentset with [reporter]
. v G) b+ O, x) C( YTakes two inputs: on the left, an agentset (usually "turtles" or "patches"). On the right, a boolean reporter. Reports a new agentset containing only those agents that reported true -- in other words, the agents satisfying the given condition.( y1 o9 \: `% x+ H- ^
它只说回传 agents satisfying the given condition6 K! J. A1 g7 u1 N
是否 with 回传的是『符合条件』的数据,而不是『所有符合条件』的数据 ? - {( G$ h1 r3 Y- u8 [/ S
" D- c, \5 k% U1 Y; ~
想确定一下0 L* N! F* l# u O- G3 l, b
谢谢!
& s: \* c/ I/ S8 b# C6 c F3 J7 m# l. O |
|