|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。. b! c- `% }; S7 |$ C7 b, ?
0 u1 C/ t$ b% b% K% [
主要有两个疑问:2 J, E0 i! w, F! [' X! [+ C
. z6 t( ]; U( Q/ f9 L. S& |4 `
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
% r/ i+ b1 B2 M# b9 B% D第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。 D- `! p6 R I* A& z* K4 r% D0 g$ B
* y G& H) e4 R+ Q1 I
- k$ d( I$ W6 o4 e4 [2 C各位高手能不能帮忙看看啊?提前谢过!; m% B, V$ h, v/ S$ E
" u- x- h4 Y& r
to form-expectation
$ ^" Z8 n" C! \ ask patches [1 s" G$ t4 @3 J$ S) S6 L
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
. }$ F3 y. l7 D `4 `- y/ d$ X set expectation para-a * ( pre-price + pre-dividend ) + para-b; q1 l! c ]/ z, }" m+ F+ t
set trader-error strategy-error of active-strategy
% @ P3 W' C8 h( } set trader-type strategy-type of active-strategy ]
* x) U" ^* {9 e. lend |
|