netlogoには、別のプロシージャを呼び出すプロシージャがあります。どうすれば価値を得ることができますか
たとえば、ハブとリンクの2種類のエージェントがあります。ハブには「budget」というローカル変数があり、その値を変更しようとしています。
hubs-own [
budget
]
to go
ask hub 0 [
do-ivalue
]
end
to do-ivalue
ask links [
;; I'm trying to set the local variable budget of the hub that's calling this link
set self.budget newvalue ;; this is obviously wrong, how can I fix this?
]
end