|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。 r6 N3 ^5 p$ D* D, f' u
0 q+ i1 F6 R1 ^/ k主要有两个疑问:
0 |4 o: j9 g2 y' n* W7 }( @( o& n1 Y/ m& ^: o+ b' o6 g7 N( p
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法? l \* S, G& \
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
5 }/ G5 _- P ^! T: j5 h& v( m; t
! }0 Q1 j% R1 i0 \# F1 }! W/ Y7 k# m
各位高手能不能帮忙看看啊?提前谢过!
; J7 g: ^0 ?0 m8 Y: u* H" f! b% ?" H$ B* C a
to form-expectation; R% U4 G$ X9 O5 n( O! d, j
ask patches [
0 R8 n2 i( I$ I' ~% K/ K let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
/ S5 b1 b6 Q% P6 J set expectation para-a * ( pre-price + pre-dividend ) + para-b& m% ]$ x8 x D8 H4 m
set trader-error strategy-error of active-strategy2 H* h4 H1 C4 g, Y8 B
set trader-type strategy-type of active-strategy ]6 `9 J* | n' W9 v/ }
end |
|