|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
. l; r# M5 B$ {7 s; j7 C. G" X- a; S9 s0 X ~* ^
主要有两个疑问:8 @! }( A- X' V0 T4 ]! f. _6 l
1 ]: Y0 B$ ~# o; Q- i2 P第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?/ U, ^/ |8 @* x* R4 Y0 w0 l, {
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。7 M o; M' O4 l7 s
9 U4 m* {* s* X
) |# R1 n+ a9 k3 R
各位高手能不能帮忙看看啊?提前谢过!; C; ]" l& G. z7 m
8 p; f0 }/ c' Y& y0 }, l, M" s6 Gto form-expectation
/ d1 i0 H/ \4 ~) A0 k ask patches [8 ^! ?, V. V! P. x5 {
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ] w$ v0 ^/ @. P% m6 w! g! w& k3 R
set expectation para-a * ( pre-price + pre-dividend ) + para-b
% |% N- k, E, ^2 z7 b) }4 I" h, M/ Q set trader-error strategy-error of active-strategy
/ O& L# Z5 K3 e; W9 E- \; e, I- [ set trader-type strategy-type of active-strategy ]
% J/ p# m( b' E4 vend |
|