|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
1 X. a( A. |/ G8 w8 c& k' V* Z# ~ H5 Y7 K' ?
主要有两个疑问:6 ~0 g G0 @! _/ `5 ?
$ m. j! a X1 t4 e
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?, v- p" ?/ q5 u C& q! t& I
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。) V) q) O. E7 t" F* V, A
6 l! X9 l) t$ F$ y1 t
1 S" K4 x7 H- ` M( [6 M1 y各位高手能不能帮忙看看啊?提前谢过!5 t, q2 s+ ~# K' j
) ~2 T6 }- l& E8 U
to form-expectation
" R5 A" C+ v' D ask patches [
3 x/ C, O0 Y$ Y' l let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
' c3 Y2 V8 ?! B9 E; e- {, H" F set expectation para-a * ( pre-price + pre-dividend ) + para-b
2 x% _3 d' U4 Q* b. v' q) O set trader-error strategy-error of active-strategy
2 w. x' I* Z) X% Q" i4 ? set trader-type strategy-type of active-strategy ]9 V2 E2 E# h" E- C S; V
end |
|