|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。$ B) o6 |, v1 x5 i0 C6 [& w, \
; H4 G4 l# P" F& c+ {
主要有两个疑问:
* b# ]# C2 j9 X l( ^! V2 Z
" G" u0 d5 E9 T; e; {第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
* W. z" ~+ v2 d1 l第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
7 n, j5 f n, q$ L# K7 u. h* `* [) {1 t. _
6 I7 ]( {! z2 i; v9 F
各位高手能不能帮忙看看啊?提前谢过!; j$ u2 U9 J+ h4 a7 l
- C8 f* N! X) f* mto form-expectation- ~; }' y. a: q* t7 P3 X
ask patches [% A. J* P1 j9 B
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]& M2 k P- L, I3 e- L
set expectation para-a * ( pre-price + pre-dividend ) + para-b
" ~! Z d: e. x0 l% x. F set trader-error strategy-error of active-strategy
3 V) o$ B' x: N" @9 A; y* x set trader-type strategy-type of active-strategy ]! j. [! Z0 h+ E' Q$ H7 q
end |
|