|
|
新手发问超简单问题,目前还处于研读范例码的阶段,边测边看结果来理解程序; E u$ r5 ^. I: v. u; H
其中有一段如下
) C x* C! w$ A# \2 y) Qask turtles with [ infected? = true ]
* E& a. v/ ~$ z我原本以为这句会回传『所有』infected? = true 的 turtle
* ?9 {2 G" a7 w但看结果似乎不是这样。. X! i& D8 `0 D: C1 ?
" k; X; Y, B/ W" h假设所有符合条件的有 5 笔* m& P! M- v# K' _, C# Q6 G( s- R
有时候回传 1 笔,有时回传 3 笔,是不固定的
% F7 D1 Q* `( H回头查语法定义$ N& }& Z, i& t* a; H% d
with
3 G6 B7 N8 ^& f! H5 yagentset with [reporter]
- b8 |# u8 M5 z7 y% R" KTakes 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.
5 I' E6 _9 S3 g$ b( [( |" ^它只说回传 agents satisfying the given condition0 @4 c) M+ {1 y0 A3 q
是否 with 回传的是『符合条件』的数据,而不是『所有符合条件』的数据 ?
8 J9 v: T& j# J _3 T( ]1 ^0 F" V" j9 c: u1 s, j
想确定一下. k/ C4 N P$ `# {
谢谢!
- L; g# l% a m4 O) v" y |
|