|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
5 m4 Q( i* E! u$ O. q1 Z( j4 Y% R6 o% W( E6 h( R
主要有两个疑问:/ H8 P+ L4 }& h$ J% G* D
7 Z( F; ~, ? [3 T, Q
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
) U6 f' U: g8 @' t. {第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
9 X& B; T+ E; |6 }; W2 n
, j8 L2 E& g1 {' P6 u* h
8 b4 o+ H/ T/ s- r各位高手能不能帮忙看看啊?提前谢过!$ D2 k& k: i, h4 B
P! @, H1 l/ ?" ?# X/ Y% V9 y
to form-expectation
* a4 ^2 o4 k" r ask patches [
. [) k8 O* \8 V; W% ~0 @; i let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
5 e G4 u# U/ Y) ^$ K1 M1 x7 I4 p set expectation para-a * ( pre-price + pre-dividend ) + para-b) E) f- I7 W) c* z( G4 c) b
set trader-error strategy-error of active-strategy
3 ?# W$ v3 K: x# p7 J set trader-type strategy-type of active-strategy ] e+ U- w2 L6 j
end |
|