|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
- ^ }7 F9 D9 N: y9 [' L& L `7 W; o6 A' n7 G$ Q4 N
主要有两个疑问:
/ w ]' n, N. }- F) Z. D t1 v( O! g
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
2 b# K. k/ ~* z第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
# X7 { r$ r3 n- P& @! j2 i* p2 E. `- |! J0 u
( r- `% Q# m: Y# t
各位高手能不能帮忙看看啊?提前谢过!/ h% d" p% T U$ L
4 r; O2 l4 T# D+ Y! `% F, yto form-expectation
R7 [$ q% U- r9 o8 x ask patches [0 `' H1 j! }2 x' _8 l9 A+ g9 \
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]" S, F4 N4 V, \/ I# t4 I* d; u
set expectation para-a * ( pre-price + pre-dividend ) + para-b: D: T( s G7 n, k! h1 R* ~ r/ u
set trader-error strategy-error of active-strategy
# b0 _- k+ w5 M |1 d/ \ set trader-type strategy-type of active-strategy ]
* }4 Y4 }" u9 f- q. p7 |& zend |
|