|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。8 j6 |3 R7 Q( d/ K/ X# D3 \
7 Q% s" A; n P# G6 X. n. h主要有两个疑问:
1 p2 I& I0 Q+ {; H8 P
/ i1 z5 r: E9 w5 q第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?( }6 u- [' X) D
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。0 K7 f8 ` ]6 t1 {& ^: H! P
5 k Q1 p8 P4 q% l* {; S
- |5 _) G5 H, R. A3 d7 I# T3 ]
各位高手能不能帮忙看看啊?提前谢过!
% B4 m) ?- O9 e8 a9 \/ v! |; |, G( J. ?5 g( a6 ]
to form-expectation5 M {3 A% @: w% _+ b2 V
ask patches [
0 ?: V v [" f3 R7 w' u let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
4 c0 N. {6 L* w& f: S3 A5 R set expectation para-a * ( pre-price + pre-dividend ) + para-b* e8 J- ?' e) ]0 Z; ]% n
set trader-error strategy-error of active-strategy
- W! S& ~1 V) K' b. f5 _5 M4 ~ set trader-type strategy-type of active-strategy ]9 P, I) B( ?: |& L% m) g) Q* \ V- U, N
end |
|