|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。( W# c% [" m4 H4 q7 [1 G4 a" V; w; B- w
% k" Q- j- ?! m主要有两个疑问:
/ x- k/ r1 U ~- _3 D# I8 n% M# y* X6 ` z+ ?
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
: S& o8 m8 Q: n; T$ R第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
# X U- f& F/ l2 c! i$ V p
2 h/ C& d* k# X2 |( ?, C; `; q- K j& }
各位高手能不能帮忙看看啊?提前谢过!( c) P: f5 z) a: O' x, X
+ C! _, x M n0 S& s! \to form-expectation& y; d1 ?+ ]! @ T& J% |! h8 [
ask patches [
* C+ C+ P8 S( c4 F, T let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
& [& H) n! J6 S) z- l: [% k7 p* ? set expectation para-a * ( pre-price + pre-dividend ) + para-b' ~/ U3 d6 c8 B% ^& m# \
set trader-error strategy-error of active-strategy) B) S$ |& x& [, Q
set trader-type strategy-type of active-strategy ]/ S6 b& a" ?' b$ `& M0 P# J4 f
end |
|