|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。1 v* f4 o% w1 y
$ w0 I5 Q7 o8 ] B8 Z' l% M主要有两个疑问:: p& N- k& j4 D* W: K& y
" g& r8 E7 }& r
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?+ }$ @0 a, v. V Z: z- W
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。/ K3 L! Z# I, H9 t- j( b/ k4 C/ _
1 i" `( X+ n, R d
?) s3 }3 k% M7 L各位高手能不能帮忙看看啊?提前谢过!
, I) g& F' {5 |+ u8 h3 `
! f8 d1 R- t7 G9 y1 m. _to form-expectation
) c0 x9 U/ u$ K7 i8 V5 M- }2 ~) e0 G ask patches [
4 ^, p2 Q9 w% n7 j0 d- @ let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
& g" _! ^: @0 `2 c! U: Q set expectation para-a * ( pre-price + pre-dividend ) + para-b
$ W0 M1 e5 Q5 W set trader-error strategy-error of active-strategy
& e, |# n5 w5 V: X g+ q1 z set trader-type strategy-type of active-strategy ]5 C& b0 l$ i- }9 Q7 F: ~
end |
|