|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。3 F; s, {6 k( y$ `" R7 r! G* Z* E6 `
0 d) j* M" \2 S( S) U主要有两个疑问:) z! U: I' f/ h* k& Y; F
5 f* z! R" ~4 Z1 _/ t. C
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
" W/ z/ k1 D2 t1 X+ v: _2 H3 M% Y第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
3 z h, x4 [4 i2 y6 f! X
6 Y' t5 X: @0 m% F. a& k4 b: u4 l+ G7 C; b
各位高手能不能帮忙看看啊?提前谢过!
8 S) x a1 X$ S2 g5 J6 u% C( q- U P ]$ R: O
to form-expectation/ _ b. q6 E. d( h" a" B* z e
ask patches [, i* L, u* K- ~' p1 f9 S
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]+ ] ~1 }4 ~! U) {0 Y, b- R
set expectation para-a * ( pre-price + pre-dividend ) + para-b
3 \) g7 d8 }% h set trader-error strategy-error of active-strategy( I( z1 O4 v2 U1 y# Z4 b7 U
set trader-type strategy-type of active-strategy ]
; |/ l: i$ ~, z/ N1 b9 S+ l3 ]; Uend |
|