|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。3 a7 ]5 Z/ i7 M+ \3 V" s
, G' o7 W2 S R" Y6 x
主要有两个疑问:
. H' ] t, c* s1 t! i9 c* h) |1 P( n {; B) V! D
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
, q& ^8 w# O- J- Z; I4 i p第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。- f+ }/ a4 s1 W/ T
0 D6 Y+ ^7 l2 k$ |! X7 ^
. l* G; [! }9 L& A3 W" F& X. H各位高手能不能帮忙看看啊?提前谢过!
! d/ @; h/ M4 K4 G* y& e: W+ K- W# Y ?$ k2 h) l( f
to form-expectation0 y4 F+ c; }) x' x$ D% t7 o) o
ask patches [ R' @1 Q. u0 I) N6 I# L, T
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ] O6 }) ]7 v. a. w/ \7 D4 _1 t
set expectation para-a * ( pre-price + pre-dividend ) + para-b
7 S) K7 _ G4 K } i set trader-error strategy-error of active-strategy
: [5 g! l7 V' w set trader-type strategy-type of active-strategy ]
/ Z+ a- Z/ j, w/ D' r y1 N( Nend |
|