|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
4 h( F4 O% M6 q0 A* |# T% E0 h0 x
主要有两个疑问:
: G2 M9 ?1 k/ K1 T9 {+ u+ k2 W$ |5 I2 [' V! a) h* q; q- Z5 V' V/ Y
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
P8 K$ q, U% f1 a/ X第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。( ~, S% i2 F; U/ @' r
' B- S z' p& I' L) T
3 P' z1 C1 V+ Q8 T% \2 |各位高手能不能帮忙看看啊?提前谢过!
, e2 q" T8 F5 |' M. p- d
( W6 N! }2 G# ^! K# O/ [7 \3 lto form-expectation$ A: r: _7 }9 K$ ?7 c! U
ask patches [
5 R( A; b4 |5 U9 B: } let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]" Y0 W, E- ^9 | _* I
set expectation para-a * ( pre-price + pre-dividend ) + para-b
$ v! p, A+ X! _' N$ C" G0 D set trader-error strategy-error of active-strategy8 j* i5 c) \$ J
set trader-type strategy-type of active-strategy ]7 K; W# K& U3 N V$ ?/ ~% `
end |
|