|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。$ ]. K, `& A% U, X( ]
, R8 Y- M6 ?% J) W7 j
主要有两个疑问:! {, b3 a" I" B1 G* h! V# e& P
9 p( n9 {# s5 u" r
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
+ d6 ]" F, C/ t5 ]第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
% [6 Z9 E! J( Q0 G7 [; T& g3 w( O! `5 m4 r- P
: X$ M# H( W4 p# n( G3 f
各位高手能不能帮忙看看啊?提前谢过!
, c* a; ]2 N' C; g( D/ g8 O- B3 A! |6 n
to form-expectation
; w9 M g3 D/ G3 A* v+ P ask patches [2 ?* r, ?# R' M& C) ~! u) T
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
+ K E( X% h6 J! h set expectation para-a * ( pre-price + pre-dividend ) + para-b
! y% K+ a Y4 Z7 s set trader-error strategy-error of active-strategy
# L; H/ t* S" X) o2 D ?7 o set trader-type strategy-type of active-strategy ]
3 Q; Z: ?( M f2 k# o: {end |
|