|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。2 c5 N a$ z% m7 B! x$ }/ Y
0 h* B) m: E& S# P; @. G主要有两个疑问:
( z4 b% k- R& m* l7 }
9 n7 A6 u' p" W# n第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
- q9 o7 q" e! o4 _* a8 K% j: g7 b h第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。8 A" T6 a6 b4 N5 ^- r$ H8 k
) W3 p; K0 H/ p: O8 N$ |- F. C% y0 Q( \& _. K: @
各位高手能不能帮忙看看啊?提前谢过!
, T3 s7 c8 D) m! i" q) V0 s: l, f' S* W3 B
to form-expectation, O8 ^9 _; {" @
ask patches [' Z4 Q8 ~, N( g7 ]1 P
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
/ T8 N' R8 t! _4 x0 k' P( l, B: { set expectation para-a * ( pre-price + pre-dividend ) + para-b
+ N W$ B9 Y$ ?" I [ set trader-error strategy-error of active-strategy
, G: o# v# e& B0 W8 O/ T& y0 B# x set trader-type strategy-type of active-strategy ]: z) p1 n( z F5 `' o
end |
|