|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。# C" z% P8 N0 u1 J
+ g" h" C9 K a1 L: [' h主要有两个疑问: f! P. o' }! Y/ _- j3 t" c/ s0 G
; p9 h4 B' m T7 F第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?5 x- Z, S9 @. m& a* H8 [6 o% ^, v( a8 V
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
0 W7 d8 X! U4 h) L4 I
5 u+ E7 i$ g8 m6 f1 D3 ~; b# C
- O7 F/ F0 l+ Q1 V& p6 |% D各位高手能不能帮忙看看啊?提前谢过!# W# t7 L& h8 V' v; A+ C1 S+ v/ f& |
: h3 r* n E# Dto form-expectation
" a% l8 ]5 W! R7 x$ v ask patches [2 u6 Z5 B1 q9 x# S
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ] V1 q8 F, w) `) k( ~( e4 a f
set expectation para-a * ( pre-price + pre-dividend ) + para-b( |5 ?0 Q' C1 E! C" F- K
set trader-error strategy-error of active-strategy
^/ f7 ^8 s& T+ D; M set trader-type strategy-type of active-strategy ]
; S: H/ B$ W2 h# B) q: H# tend |
|