|
|
我想把在每一个patch上的turtles经过一定标准选择选出一个,然后把这一个turtle的一个属性变量传递给patch,写了下面的代码。- r1 d1 V" W7 v4 t& _
9 Q( J/ u w6 t; y/ j! A% N' A8 F" z主要有两个疑问:% S! L6 b2 r3 @! @; ^+ m
, R) {( ~- u# T1 N
第一,我是用of引用turtle的属性的,可是通不过编译。应该用什么办法?8 i' q+ ^0 M' u- x" V ? J4 V. d
第二,set expectation那一句里的para-a和para-b也应该是被选出来的turtle包含的参数,可是目前这个写法似乎不能体现出来这个意思。1 y1 h& |% p; v- z8 b' g
( |; w S% L" s g# Q
8 z+ h2 b: k; U. `$ S各位高手能不能帮忙看看啊?提前谢过!
; J K5 \; E" J3 w6 P
# C3 c7 C, u4 u* V+ Yto form-expectation
" E" V8 o- o3 d ask patches [
4 Z6 z( J+ m' S4 ^# I let active-strategy min-one-of ( turtles-here with [ length ( remove true (map [?1 = ?2] predictor descriptor) ) = length ( remove "#" predictor )]) [ strategy-error ]7 \, l# ]& T2 M1 M
set expectation para-a * ( pre-price + pre-dividend ) + para-b3 X3 T4 s/ r7 h" Z
set trader-error strategy-error of active-strategy
" r. l# N& J" m1 g0 X set trader-type strategy-type of active-strategy ]$ ^; ~% t+ K, y: Z9 E8 l6 {9 g
end |
|