|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
; c, R# Z6 `3 Z) Y8 ~! w" m o: l) F
主要有两个疑问:
" ~8 s! I1 Y2 C, ?. R: M" ?& u7 l8 S# P5 B# Q4 T
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
! K4 Y2 c* F8 F& z$ e+ i) g- C第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。# ~& h3 ~( }6 V B- s0 X+ M
" s- b% W, S, m# O: @
4 \' Z* }. x: _4 V8 P* n0 L8 X' _各位高手能不能帮忙看看啊?提前谢过!, {+ V0 \. M* Y! Y8 y( _* c9 a
# A7 a5 F1 b: B* {- kto form-expectation
! i# u$ M, R0 h( ]. N: Y/ G ask patches [
( i* r1 I# Z( r2 c. S& |& _ let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
3 ?& g( f9 B ~, T set expectation para-a * ( pre-price + pre-dividend ) + para-b. E! D+ J* l0 {6 M$ i, p2 n) Q
set trader-error strategy-error of active-strategy
4 T. |! Q0 q( W5 p8 S& F7 T set trader-type strategy-type of active-strategy ]7 K: u. R; C( L% ~" K. D
end |
|