0

在我的模型中,我有 3 个生产商,每次运行后,他们每个人都有 2 个值,用于从他们在市场上销售的车辆中获得的利润和销售额。模型需要运行 100 次。我遵循了行为空间工具的步骤,但我不确定要为“使用报告器测量运行”部分添加什么。我发现这篇文章在此处输入链接描述。之后,我使用了这个

[(list who profit)] of producers [(list who sale)] of producers以查看“谁”的数字以及相应的利润和销售额。这有一个错误说"reporter for measuring a run fails to report result - NULL"。我该如何解决这个问题?还要提一下,代码中没有没有return的to-report,但是返回的东西不是我想要收集的。

谢谢

4

1 回答 1

3

你能包括你的breed和特定于品种的变量声明吗?你的记者语法对我有用,只要它在Measure runs using these reporters现场的两行。

此外,如果需要,您可以将输出简化为单个报告器 - 使用此玩具设置作为测试:

breed [ producers producer ]
producers-own [ profit sale ]

to setup
  ca
  create-producers 3 
  reset-ticks
end

to go
  ask producers [
    set profit profit + random 50
    set sale sale + random 5
  ]
end


还有一个 BehaviorSpace 实验,如下所示:

在此处输入图像描述


您的输出(使用“表格”选项)应如下所示:

在此处输入图像描述

那对你有用吗?

于 2018-06-19T23:09:29.543 回答