|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。* i. H9 ?- x9 Q4 r3 O
- N: R* X/ J9 {, F. U
主要有两个疑问:
$ H4 t' t+ e6 h* a- ` J9 \! e3 Z8 j' k; d6 b
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?% V1 _; h o2 `% f# K- b
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。# [) q( `* l9 H* }# H
1 p7 d s' }" ~; v$ b0 g* H2 ^9 r- X( T( r3 T2 x( e# _# s( h
各位高手能不能帮忙看看啊?提前谢过!
! Z; I+ K8 n9 j' ~- ?7 o
# c+ M9 l9 r! _to form-expectation
* _3 W/ q0 u4 n3 J ask patches [+ G7 ]' a6 R& L0 S9 Z" T
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ], n1 I4 `3 h. y: [6 B, E
set expectation para-a * ( pre-price + pre-dividend ) + para-b7 l- D# \9 j: E7 y/ B7 C+ T
set trader-error strategy-error of active-strategy7 a, T y8 [/ ?" N' N" @' ], W0 l
set trader-type strategy-type of active-strategy ]7 ]+ c; V' q3 V9 a* s
end |
|