|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。- n$ _3 W, B8 q/ }5 ?$ N" d$ r
1 D! N6 r7 t, i2 g" ]主要有两个疑问:
$ ^; f, |$ t% g+ T$ y0 s( i+ \: T& F5 r+ T% J. [
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?; g0 f0 m! `6 [# d) u) G. z) |
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
/ W* u) p2 e+ V; R/ ?" ]9 |8 C9 Z. Q; [
: v2 r+ ~ N- |# {% j
各位高手能不能帮忙看看啊?提前谢过!. A1 d* C+ Q; H# |7 j2 t5 S
- h/ N/ q6 R' d2 L' R: D8 P
to form-expectation& L" s# \" x) h" p* w
ask patches [
2 v- }7 H. Z5 A+ f8 y C" U let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
$ }) u0 g5 A* \5 [$ F3 [# O set expectation para-a * ( pre-price + pre-dividend ) + para-b& j' F) v# ?# u) d. C% q) }
set trader-error strategy-error of active-strategy' P' S) d s, {$ x! h0 Y; V
set trader-type strategy-type of active-strategy ]! W$ o$ S6 D9 l8 D8 w# F) D
end |
|