|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
) m' z0 q6 `: N: P+ C* P7 E' e0 T: u# X. v) P$ ~* {6 w/ u! l
主要有两个疑问:
% D& ?8 O" j! w* L) F& ~; R; L# |
; N1 @! [1 r. K$ E! X8 k# T第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?5 r$ `" _8 y5 r! ~2 ~! a
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
9 f- c8 K' U- l! A$ X* H) ^" d9 ]$ }) N, }( D; U& Q
1 i- S/ k9 M, C5 k7 T1 N各位高手能不能帮忙看看啊?提前谢过!9 A7 f4 c/ m3 l% x! o- p
% R/ X% D6 U" v$ bto form-expectation! l$ j6 k- V, h: H9 K& G, Y
ask patches [
& S+ V( o! e$ p8 T' z7 e7 @& H) s let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]# R! b% J" v4 d# g
set expectation para-a * ( pre-price + pre-dividend ) + para-b
/ k% n5 I$ ^+ X6 v* B5 G" x2 y set trader-error strategy-error of active-strategy
/ a! _7 |4 j3 H. q4 H1 d set trader-type strategy-type of active-strategy ]
, [! Q/ e4 I& U6 M, k1 F: ? A$ _end |
|