|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。- j+ m9 ~( O" w+ D l
, [% D* I2 ~5 z8 L1 Z1 b( u- F; L主要有两个疑问:7 z8 s/ ^* z/ r7 V: n
- u: U: `8 y. U
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?7 l: d% i) H2 v4 l3 ^4 O
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。 O( p9 @8 W9 ]# ]& \, [
6 w5 z6 U; ?7 E( A* F7 n* F8 ?' J/ j: `7 O
各位高手能不能帮忙看看啊?提前谢过!
, ~% U# m9 u; M( g, D1 B; ~+ V- b6 b, g- g5 q7 w
to form-expectation
1 W; `) N) |; W* H9 O" Y/ w ask patches [- k7 G5 g' K) E+ q" ~+ R" I
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]: a, ]# V5 t, X
set expectation para-a * ( pre-price + pre-dividend ) + para-b
1 e# _' m8 r/ r* N f h" z1 n set trader-error strategy-error of active-strategy
" x! \* @3 p8 H2 g5 ^ set trader-type strategy-type of active-strategy ]
' F b5 v' U" ?% E2 }end |
|