收集代理人口统计数据(Gathering statistics on agent population)

在我一直在使用的模型中,我收集有关人口水平统计数据的一些问题。 在模型中,我有一个代理类型Company和RawMaterial。 在公司内部存在一个流程流程,在某些块中,在输入RawMaterial时,成本被分配给公司中的变量(例如, cost = gamma(3, 125, 0); 3,125,0 cost = gamma(3, 125, 0); )

要计算公司级累积成本,我在此对象的值字段中使用一个包含cost的统计对象。 看起来好像很好。

但是,如果我想将所有公司代理的累计成本累计为一个值,我会遇到麻烦。 理想情况下,我希望将每个公司代理的累积成本绘制在Main中。 我查看了帮助文件(“收集座席填充统计信息的函数”一节),但没有成功。

I have some issues with gathering statistics on the population level in a model I've been working with. In the model I have an agent type Company and RawMaterial. Within Company a process flow exists, where on some blocks costs are assigned to a variable in Company upon entry of RawMaterial (e.g. cost = gamma(3, 125, 0);)

To calculate the Company-level cumulative costs I use a Statistics object with cost in the value field of this object. So far so good it seems.

However, when I want to sum the cumulative costs of all Company agents into one value I run into trouble. Ideally, I want the cumulative costs for each Company agent to be plotted in Main. I've looked at the Help file (section "Functions to collect statistics on agent population") with no success.

最满意答案

那么主要做什么呢? (你甚至可以把这个函数放在你的时间图中)

sum( companies, c->c.cost );

此函数计算所有公司代理的成本总和(只要您有一个名为公司的代理总数,而不是代理类型)

如果您没有公司作为代理人群,您必须创建它,否则计算任何东西都非常困难。 如何创建它取决于你的模型。

what about doing this in main? (you can even put this function in your time plot)

sum( companies, c->c.cost );

This function calculates the sum of the costs of all company agents (as long as you have a population of agents called companies in main, and not only an agent type)

If you don't have companies as a population of agents, you have to create it, otherwise it's very difficult to calculate anything. How to create it depends on your model.

收集代理人口统计数据(Gathering statistics on agent population)

在我一直在使用的模型中,我收集有关人口水平统计数据的一些问题。 在模型中,我有一个代理类型Company和RawMaterial。 在公司内部存在一个流程流程,在某些块中,在输入RawMaterial时,成本被分配给公司中的变量(例如, cost = gamma(3, 125, 0); 3,125,0 cost = gamma(3, 125, 0); )

要计算公司级累积成本,我在此对象的值字段中使用一个包含cost的统计对象。 看起来好像很好。

但是,如果我想将所有公司代理的累计成本累计为一个值,我会遇到麻烦。 理想情况下,我希望将每个公司代理的累积成本绘制在Main中。 我查看了帮助文件(“收集座席填充统计信息的函数”一节),但没有成功。

I have some issues with gathering statistics on the population level in a model I've been working with. In the model I have an agent type Company and RawMaterial. Within Company a process flow exists, where on some blocks costs are assigned to a variable in Company upon entry of RawMaterial (e.g. cost = gamma(3, 125, 0);)

To calculate the Company-level cumulative costs I use a Statistics object with cost in the value field of this object. So far so good it seems.

However, when I want to sum the cumulative costs of all Company agents into one value I run into trouble. Ideally, I want the cumulative costs for each Company agent to be plotted in Main. I've looked at the Help file (section "Functions to collect statistics on agent population") with no success.

最满意答案

那么主要做什么呢? (你甚至可以把这个函数放在你的时间图中)

sum( companies, c->c.cost );

此函数计算所有公司代理的成本总和(只要您有一个名为公司的代理总数,而不是代理类型)

如果您没有公司作为代理人群,您必须创建它,否则计算任何东西都非常困难。 如何创建它取决于你的模型。

what about doing this in main? (you can even put this function in your time plot)

sum( companies, c->c.cost );

This function calculates the sum of the costs of all company agents (as long as you have a population of agents called companies in main, and not only an agent type)

If you don't have companies as a population of agents, you have to create it, otherwise it's very difficult to calculate anything. How to create it depends on your model.