|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。 q0 o6 f7 c0 S" @
* M$ a4 e R8 k
主要有两个疑问:6 V r* t; x# |$ `! K
9 r& n6 U- u4 C$ b& a3 M第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?) x) `1 {& j# s0 z6 t) J
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。
7 [, v0 e4 a$ k! T# R7 \1 D$ g6 g( K- e9 @2 V3 v
+ a" K$ N# X3 i q各位高手能不能帮忙看看啊?提前谢过!+ {; q) A8 s) a( g# v* L
2 y0 B$ X$ ]( ^8 z1 s
to form-expectation
* K5 f. G5 O/ x* S6 D ask patches [
, V- c- P6 \5 s$ {4 Y) w let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]1 F/ W5 o. }1 U
set expectation para-a * ( pre-price + pre-dividend ) + para-b$ @" C$ ~+ ^ e- H
set trader-error strategy-error of active-strategy- _9 y# m- {, o- a f
set trader-type strategy-type of active-strategy ]
) O1 o p: P# l) D6 @end |
|