question

Cindy Azuero avatar image
1 Like"
Cindy Azuero asked Jason Merschat commented

Wrong statistic graphics in process flow

outputperhour.fsmI was trying to obtain the output per minute statistic from an activity on the process flow. First I attempt to Pin the output statistic of the activity to the dashboard and then I modify the graph properties as follow.

I though that this will return the output value after every minute has passed.

Then I realized that that is not the same as output per minute, because I thought it was only taking the last data of output in the range I established. So, I used the predefined option of the library for process flow statistics called Output per hour and I realized it has the same configuration as the one I configured above. In this manner of facts, I realize that the graph is not really calculating the output per hour. To confirm that, I create the same statistic using the objects from the 3D view where a know the statistic is well calculated and as I expected the graphics are different.

I'm sending you the model where I test this.

FlexSim 16.1.2
process flowstatistics
outputperhour.fsm (22.4 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Matt Long avatar image Matt Long commented ·

It does look like the chart is including both ends of the minute, so when you're using 10 second intervals that cause the output to charge on exactly the minute, you're seeing a larger value than expected. We'll put this on the dev list, but if you're using numbers that do not land you write on the minute, you will see the correct output per minute value.

2 Likes 2 ·
Cindy Azuero avatar image Cindy Azuero Matt Long commented ·

I don't understand exactly what are you refering to.

0 Likes 0 ·
Matt Long avatar image Matt Long Cindy Azuero commented ·

I was just responding to what you said about 'the graph is not really calculating the output per hour'. The value you're seeing in the Process Flow chart should be 24 per hour but you're getting 28 which is just due to your delay time being exactly 10 seconds causing a total of 28 tokens to be leaving the zone in the span of 60 seconds. Where as you would expect it to be 24 tokens, 4 tokens every 10 seconds.

1 Like 1 ·
Jason Merschat avatar image Jason Merschat commented ·

I agree with Cindy. This canned time series graph shows cumulative output and not a rate (output per hour) I am looking to have a time series of output per hour as a rate not as a cumulative over time. Whatever the intent is, it is not translating to us users.

I submit that the Output per Hour bar graph does indeed show instantaneous output per hour, and that is what I am aiming to capture in a time series.

0 Likes 0 ·
Matt Long avatar image
2 Likes"
Matt Long answered Matt Long commented

The two graphs are different. The standard Content vs Time graph that you set up to be Output Per Minute is doing calculating the output per hour as the model runs. You could think of this as more of a running average. The equation that chart is using to get each of its data points is:

output / (time / 60)

The Process Flow chart is giving you the actual Output Per Minute. It does this by recording the output each time it changes and then graphing the last minutes worth of data.

If you want to display a graph of the output / (time / 60) using Process Flow, you can write that data to a tracked variable and then graph the tracked variable. Create a Tracked Variable through the Toolbox with the Level type. Then somewhere in your Process Flow add the code:

treenode delay = getactivity(processFlow, "Delay");
settrackedvariable("OutputPerMin", getstat(delay, "Output", STAT_CURRENT) / (time() / 60.0));

Then create a Tracked Variable vs Time chart in the Dashboard that is linked to your OutputPerMin tracked variable.

· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Cindy Azuero avatar image Cindy Azuero commented ·

Thanks

0 Likes 0 ·
Cindy Azuero avatar image Cindy Azuero commented ·

@Matt Long which place could be "somewhere in your Process Flow"? I try to put this after the delay in a custom code, but I realize that the graph must be constructed every second...

0 Likes 0 ·
Matt Long avatar image Matt Long Cindy Azuero commented ·

Well it's all dependent on what kind of precision you want in your graph. If you want it to be calculated every second, just add a Schedule Source or use a Create Tokens to kick off a token that goes through a Delay of 1 second and then to a Custom Code to write to the tracked variable, then loop it back through the Delay.

1 Like 1 ·
Cindy Azuero avatar image Cindy Azuero Matt Long commented ·

yes, I try that, but I have a question. In this model if I use a delay with 1 second it is problematic, but if I use a delay of 30 seconds it works fine. Which could be the cause?

graph with delay 1 second:

graph with delay 30 seconds:

0 Likes 0 ·
delay-1-s.png (20.2 KiB)
delay-30-s.png (18.0 KiB)
Show more comments
Cindy Azuero avatar image Cindy Azuero commented ·

About your question "Over that length of time are the results that much different doing a larger time interval?" the results do not change a lot, Its just a question in order to determine the time delay when i want hours. I just wanna know if there is any rule about it. I can us a bigger time interval.

0 Likes 0 ·
Matt Long avatar image Matt Long Cindy Azuero commented ·

It's a bug that needs to be addressed, it's just a more difficult problem than one might expect. As for a rule, no, really it's just trying out a time interval and seeing if it works. A lot of it will depend on how long you're running your model for.

1 Like 1 ·
Adrian Haws avatar image
1 Like"
Adrian Haws answered Cindy Azuero commented

Cindy,

That's right, that's how it's supposed to work. The "Output per Hour" for a Process Flow activity displays the output value for the last hour (or whatever time unit you have set) while this statistic for a fixed resource displays the average output per such time unit over the entire run time.

If you want to display an activity's average output per minute, you can create a text display in your Process Flow and enter code similar to this:

treenode delay = getactivity(processFlow, "Delay");
if (time() == 0)
	return 0;
return getstat(delay, "Output", STAT_CURRENT) / (time() / 60.0);

See example model below.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Cindy Azuero avatar image Cindy Azuero commented ·

Thanks @Adrian Haws but if I need to graph that statistic vs time? I mean, if I need the graph and not the text display? is there any way?

0 Likes 0 ·