|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
, E* ]) z( M" }$ z6 v! s9 ^6 S0 C9 `: u; ^) d4 k
主要有两个疑问:
. Z, U: [* N) g( p6 G8 ~- u2 Z; u) U a( W6 c
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
- c5 J) B+ f# F; a/ J' h第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。. k4 W* H2 b4 B% W, P
* n* b1 V ` D3 g
5 d3 q- p8 B/ ]6 h+ k* J: ~# [' l各位高手能不能帮忙看看啊?提前谢过!
) h8 N N) R5 P0 q5 b4 z, z
- ?, D1 X. p9 L1 ?to form-expectation# s. ^) ~% V- Y, Q& ]
ask patches [
2 l Z. j p8 A let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]3 P1 z6 Q; F% }6 s$ @+ i8 o6 ]
set expectation para-a * ( pre-price + pre-dividend ) + para-b
$ \8 m' o' I4 b. r" ~$ v$ ] set trader-error strategy-error of active-strategy
' ?! h2 v# _8 O/ x7 [4 [ set trader-type strategy-type of active-strategy ]' }$ x* ?3 z2 n B7 S& m
end |
|