|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
3 T4 r0 W9 y9 f- E; s& L9 h* j6 P! j P4 K& C
主要有两个疑问:
( g/ S( i7 o0 g+ x: A
, d, n" ]& i& p第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?( S9 q, b' K" A" Y' G# R0 N
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。2 q2 }# ^- d B' c
+ h2 V1 V3 W0 @' S8 j. r0 r2 d: j7 l% Y
各位高手能不能帮忙看看啊?提前谢过!; p6 P- ?* \+ ^+ ^+ k: K
: X* C: ^5 l* S* Q
to form-expectation7 x/ v# c9 e' ^ [: A+ o
ask patches [
3 G- ^( {, O" `6 Y) s let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]* k0 v/ _3 q' T9 p
set expectation para-a * ( pre-price + pre-dividend ) + para-b
3 o7 s* r3 N X5 d' Y6 c T+ \ set trader-error strategy-error of active-strategy
3 K' q9 U+ W/ L set trader-type strategy-type of active-strategy ]0 X, h1 B2 ~# U3 W9 S7 n
end |
|