我的 netlogo 程序有问题。代码如下:
globals[
growth-param
money-size-ratio
]
turtles-own[
location
tsize
bbalance
]
to setup
ca
reset-ticks
ask patches[set pcolor blue]
create-turtles initial-telemarketers [
set size 1
set bbalance 0.0
setxy random-xcor random-ycor
set shape "circle"
]
set growth-param 1000
set money-size-ratio 0.001
end
to go
ask patches[set pcolor blue]
sell
accounting
observer-updates
tick
end
to sell
let territory 10 * sqrt size
let maxcalls 100 * size
ask n-of maxcalls patches in-radius territory[
if pcolor = blue [set pcolor black]
set bbalance bbalance + 2
]
end
to accounting
let cost size * 50
ask turtles[
set bbalance bbalance - cost
ifelse bbalance < 1
[die]
[set size bbalance * growth-param]
]
end
to observer-updates
end
简单地说,它应该是有多少电话营销公司互动的模型。它来自 Railsback & Grimm 的建模书。
每次尝试运行时,它都会提供两个我可以看到的问题:在程序 sell 中,它不想将 bbalance 设置为新值,因为它是仅海龟,而 tick 仅是观察者上下文。
谢谢你的帮助!