|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
- z4 e# q* _" L$ \9 h& y6 m. y4 O M
主要有两个疑问:
1 l4 _- l2 ^) P* \# ^ m
' f* H% P6 t6 `8 \* h. r8 U: N第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?6 {9 t1 }6 j# N2 P
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
" L2 W! }8 m5 q U
3 E5 p0 C% c! y) }
( S/ B! b& E4 ?6 t0 M4 e) {各位高手能不能帮忙看看啊?提前谢过!% }* }, b4 M, L/ T2 q; e, @# e O3 i
4 x: x& H* Y! {9 r
to form-expectation
+ _' p( F5 `6 y0 i1 I9 \ ? ask patches [
) N. J' \1 e% f4 I4 W let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]1 n- m K$ T. [: M/ g+ F5 [
set expectation para-a * ( pre-price + pre-dividend ) + para-b
! }1 L( N1 Q+ K, S( _, ` set trader-error strategy-error of active-strategy4 N8 W* G( M* }
set trader-type strategy-type of active-strategy ]
6 T& c. R' u0 h+ i1 ]- D9 C5 zend |
|