|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。, D- d% G" I1 P/ ]
4 h4 S6 L3 ~& d: F( w主要有两个疑问:7 ?' o6 a) g( E7 n; M- d4 t
# t ~5 F+ v7 r" e) v( V: m第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?0 G! n: r8 K0 l- i; J, ~ Y
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。$ f7 ^# F+ M5 L$ C
6 J4 u G# c& I4 D% M5 w2 `
' E& e! k1 i" j+ Q" u
各位高手能不能帮忙看看啊?提前谢过!4 b6 N6 ^+ A& |% o2 C: f
# s3 o4 E# @" {4 {to form-expectation
1 |8 ~( ^( m+ L' w+ \( } ask patches [( n- G" U# `( E1 I2 \5 P
let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]- m: T% v4 e* \ }- b; Z
set expectation para-a * ( pre-price + pre-dividend ) + para-b- _2 b% E) d @. \5 b3 a) ?
set trader-error strategy-error of active-strategy
9 M _! h9 a/ M" j( t( a$ a, K set trader-type strategy-type of active-strategy ]! M/ Y7 s' e3 g" a+ v( c: [& o
end |
|