|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。9 K( C, ?. d: [. `# `1 j; @+ x# @9 h
9 ?5 ?; t+ H( t% |" r! W% `主要有两个疑问:
; @. D4 a8 P; _ `8 \9 v4 n5 o
1 g. A( T* o9 X第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
5 }2 D1 G. a6 ]7 H第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。$ H8 W1 w5 }% h+ W
U$ N# G* V7 m- w( \& X. D3 Y
$ \$ g: J4 C+ a9 p各位高手能不能帮忙看看啊?提前谢过!
, c9 z) Z# s: P9 [+ {! \
, w0 [. v L4 F: K7 jto form-expectation
* }6 c' n# Y+ h6 f ask patches [6 b0 f( }( B6 @, L
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
7 B7 c! C+ t0 D# Z- }: ~. n% \ set expectation para-a * ( pre-price + pre-dividend ) + para-b- m7 v9 h5 Y0 v& x% { G+ L/ `2 _
set trader-error strategy-error of active-strategy
2 G6 E8 s; T8 d) I- L- g, i set trader-type strategy-type of active-strategy ]
& @. B( Q) {9 G( g y% F) W) Wend |
|