|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
+ k/ j4 S7 l- T! l0 l% R! Q$ A/ `6 n' V, S3 _+ y1 y7 z
主要有两个疑问:7 u, K# c" [- j2 w/ N
, o5 m, P6 Y7 M1 K& R' b第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?& v2 r% w+ G$ A7 X
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
5 A; k# K' N5 @9 s; m6 ?2 M1 k# ~+ X
: {" S2 Y0 E5 @, Y2 X2 z2 [/ Q: [5 W' J( Y$ i& ~
各位高手能不能帮忙看看啊?提前谢过!0 t1 z% l$ n$ V. k2 ]0 ^2 ^# S" W
2 f+ R- U2 O# J4 W/ y( v1 \$ A$ Xto form-expectation0 o( ~5 g" L7 X5 [" O2 Q& m5 a# V5 L
ask patches [4 ]- x, t9 t6 @- ?
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
( w6 {( c/ J( x0 n; u set expectation para-a * ( pre-price + pre-dividend ) + para-b# y+ w& P/ \+ R' L4 f$ x/ P5 K
set trader-error strategy-error of active-strategy
' S8 p4 b Q2 h9 ?0 {: h k; _ set trader-type strategy-type of active-strategy ]
* u5 V: t! a `end |
|