|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。7 z) P+ ?5 a" m5 g
6 ~6 Z4 Y( ~6 A* o0 F) u主要有两个疑问:
8 i9 Z3 V$ O" [& d
" o* a+ I7 i# Q第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?8 ^6 n$ Q- d2 C- f6 @
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
7 U& J/ i: T4 E& _- b2 B |" ` o' R" b9 n# I- T' R
. K$ c5 \. P9 K% O$ `' S. p; Y- i, E& v各位高手能不能帮忙看看啊?提前谢过!" Y5 A% N- e- c2 R8 n
" b! D4 o7 y- |. L9 Y
to form-expectation
: o; A) c5 I+ Z, \" k ask patches [
P0 S9 J7 J' L& ~1 Y+ Y* k1 J let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]( c$ R5 M2 h2 K4 X ]; z
set expectation para-a * ( pre-price + pre-dividend ) + para-b( H* h4 A% n0 P0 U9 p5 Y4 w
set trader-error strategy-error of active-strategy
+ s1 x" B; w- V# B* O4 n set trader-type strategy-type of active-strategy ]
/ d) ? B, R- a8 g! `! N \end |
|