|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
2 J3 n' a1 u8 x/ m j. c4 K/ a1 p: E. ^) Q# X
主要有两个疑问:8 U' R2 N( z* E/ z/ C- \ C
1 ^2 t( ]! ?$ U% g, Y" M
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
% D6 b" p4 e2 b: M+ u c) ~第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
- V7 E- O1 k! J$ T( b: ?9 a
; r8 ~4 B2 o9 ]; ^) g: D
# ?; i& X: I& ?$ R4 O0 Z各位高手能不能帮忙看看啊?提前谢过!
) \6 v8 r. T) c* W, {
[- ~! A. q& ~' h& r0 ~" ~2 _to form-expectation
! h3 g/ a; E9 z1 b2 w ask patches [$ H7 D4 W C8 O5 Y6 R6 Q8 C
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
+ g3 R) o, t4 d% ~" U set expectation para-a * ( pre-price + pre-dividend ) + para-b
8 D% O+ P) G7 A1 A' f" F+ B set trader-error strategy-error of active-strategy. d$ g4 w3 v1 X; y7 D
set trader-type strategy-type of active-strategy ]/ ?$ ^& Z9 c/ I
end |
|