|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。' K" p3 q8 F! S5 c; j
" k& G( [( R: ?$ U, C1 W3 e+ W主要有两个疑问:& _3 {% F2 O9 {5 _) M
7 C* W+ A% s. ]第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
* `7 T( N, r- _' s! I# j3 U第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
1 V) {" e% u9 p& e% v% B
/ Y7 R* D6 Q* {! u/ v$ c* z7 _4 b5 \) K9 d; S/ M/ ~
各位高手能不能帮忙看看啊?提前谢过!: I1 [4 |6 X; o* a
# f4 ]6 d* i* n1 mto form-expectation% [. W6 T+ {% f
ask patches [
8 d: D, T( O) t% T) R' c' K let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
' ~( ^3 m2 O/ M8 E) \: q; i set expectation para-a * ( pre-price + pre-dividend ) + para-b+ A, p6 K2 U; m; w
set trader-error strategy-error of active-strategy
9 b# r$ S. i4 C3 w9 b0 e set trader-type strategy-type of active-strategy ]
- R: {4 o$ k7 o% b3 n+ B+ Uend |
|