|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
9 R& ]( J/ M% ?8 `+ S6 n* B
. k5 K" {2 V1 y主要有两个疑问: C4 r9 n9 f( s, A5 |$ a' O, }
, O2 x4 J1 [* s; O8 l5 q
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
* p5 l( L0 y% ^8 S7 _第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
& Y/ X8 D/ o$ s! i" v( |" W3 ~6 r7 I4 ~1 ]! o7 x# ^
7 W( c1 \7 M7 p0 F' c) U8 q
各位高手能不能帮忙看看啊?提前谢过!
" T( ]6 n3 {. U7 ?2 h7 e: P
" [& Y6 Y/ H; J- }8 \0 Nto form-expectation
4 a/ H$ _, u5 F* V. @' G ask patches [
- L3 D! ~, ^/ K v* ~+ C' D& d let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
! ]" N" @2 {2 s3 F. Z5 Q set expectation para-a * ( pre-price + pre-dividend ) + para-b
6 Z) D1 Q a7 }" f set trader-error strategy-error of active-strategy* K6 s& P; g: k1 Y, L
set trader-type strategy-type of active-strategy ]
4 u' F: h1 y/ Q# c& l8 L; r+ kend |
|