|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。3 h! v5 a; W9 Z# z% q
) @( {5 o M6 N2 {9 n
主要有两个疑问:
# l( }7 t8 J ~: S8 n: p: J3 W3 q+ j( M; ]
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?9 E. M0 M6 H4 z9 w+ N! t: x
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。) s% U: b0 [3 H/ w
V4 e0 T u3 F( B, V& t |4 y% b) @( _# `# i
各位高手能不能帮忙看看啊?提前谢过!; U% }, s8 A1 A0 A( R8 j% Z
- F! n) w ]" Cto form-expectation
" g4 |3 e2 i* C6 y ask patches [/ r) |. {0 N! B& T- ^4 \7 j2 T
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]+ t4 p% e* }/ Y# ]1 _+ D/ K
set expectation para-a * ( pre-price + pre-dividend ) + para-b
: J/ P+ J Z" L5 r, e set trader-error strategy-error of active-strategy
% c! ~% S7 b% {* I( Z: q3 F set trader-type strategy-type of active-strategy ]1 G3 }) ?4 n! r5 l" L/ W' }5 v5 f
end |
|