|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。
9 ]2 R: x8 e4 N5 e# x1 w( F; Y h
主要有两个疑问:& ?$ ?* l5 y' M9 Y+ ~' m; [% a9 M6 z
, c4 N7 I9 l& S9 X第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?
* j! ?% z$ C# u' K6 [" q: v! N5 A第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
- q6 A, G8 P( F& O' {, s+ ?. s( Z; D0 y! N% M( K
9 C6 B0 j) u! m3 E' e" e; H- X5 P
各位高手能不能帮忙看看啊?提前谢过!2 t1 T( c' I r7 W: H% e& f
' y6 z' O, e9 q9 L
to form-expectation, i) f7 S2 {! c" N5 P/ M8 h0 o
ask patches [
3 P+ T0 g2 [1 ~1 M3 E let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]
1 x" p; f X5 U* V4 { set expectation para-a * ( pre-price + pre-dividend ) + para-b/ q2 \. X$ T9 ^) ^; ]6 q0 S
set trader-error strategy-error of active-strategy
, B H) }: d3 y set trader-type strategy-type of active-strategy ]% x% M i' D; h* v
end |
|