|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
3 ]) s! S/ \# T0 B) P
+ `6 K1 V' n5 b( I. I# u主要有两个疑问:
; X" o+ Z7 U( M* c) }5 T% M5 j* {& V% ]8 K% X3 d
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
3 b2 F& M& Z3 ~, m0 j第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
% q; H/ l8 ^* h0 D! c" H4 R& E5 o
/ t, ^, m! v" t& U% O
+ J1 \" t2 [; Y! H' F: Q/ W& j各位高手能不能帮忙看看啊?提前谢过!
^: i$ @$ `# t. B; ^! I' u1 O2 I6 v, n6 V
to form-expectation
0 e M- t3 q# @, N; \ ask patches [
" K( h1 n9 E8 a; g, ]4 a let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
! Z3 ]+ h7 j4 R# s# [+ J* C- H set expectation para-a * ( pre-price + pre-dividend ) + para-b! N2 T1 l! G9 E( Y% p- H! f
set trader-error strategy-error of active-strategy
5 p3 s! Q! [! A( t2 P0 \# S9 t set trader-type strategy-type of active-strategy ]
+ P( _6 Q" t) p! Q5 U6 L/ zend |
|