|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
6 i/ F3 S' u! `+ y' o" n/ V5 r* @4 p9 ~
主要有两个疑问:
9 M; Y( H G9 t% C
) \. O6 v e8 T. I第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
2 o, [4 Y, t; Q9 t" V0 E第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。$ e' x. A0 `& M) z5 _
0 [9 T/ w0 {! n
* `* ]3 s5 Q) L; u6 q( y* h* F
各位高手能不能帮忙看看啊?提前谢过!
5 k6 A* A4 _7 V3 M4 R6 y. [# k0 R/ C
to form-expectation
) P; c- @" y8 b7 ? w/ Q* [: o ask patches [
7 ?1 o/ K" p. g! g0 f let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
. h1 M C& I; Q set expectation para-a * ( pre-price + pre-dividend ) + para-b- U/ m+ i1 L1 b
set trader-error strategy-error of active-strategy
7 A3 c& Y, f& G- Q7 y- S! S! ?4 r set trader-type strategy-type of active-strategy ]+ z: I1 r" B3 ~
end |
|