|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。# i, A' w' h O/ `8 b' W9 f2 }
. F# U* ~: r6 |5 b+ H' f+ |, g+ {主要有两个疑问:
- a2 l2 Y( }& A$ X1 o p- j1 T6 Q% c7 T w' B
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?) m3 V$ u2 R3 ]7 [; }5 t, d
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
' ?4 |! g" e! L/ d" T( s+ p
8 n: y! P* F, c4 Z( m5 Q! u9 l" V7 `4 p1 G0 [! _# c
各位高手能不能帮忙看看啊?提前谢过!* G8 j% W% s/ n0 j* f
" G5 C0 J" H2 x0 t( u- [; i/ ^
to form-expectation
( p2 Y F$ y- Y0 `1 k ask patches [
9 ?4 a& p8 K# Q- p let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]5 @- G) o \; ?/ B5 j/ W% @0 n8 S
set expectation para-a * ( pre-price + pre-dividend ) + para-b
1 t( E2 {4 l* o2 F4 {) I" X set trader-error strategy-error of active-strategy8 ]" E& F3 ?0 ~, T
set trader-type strategy-type of active-strategy ]" F {" }6 Q; u) _
end |
|