Wrong statistic graphics in process flow

Wrong statistic graphics in process flow

cindy_azuero
Not applicable
2,282 Views
14 Replies
Message 1 of 15

Wrong statistic graphics in process flow

cindy_azuero
Not applicable

[ FlexSim 16.1.2 ]

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.

2112-pin-to-dashboard.png

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.

Accepted solutions (1)
2,283 Views
14 Replies
Replies (14)
Message 2 of 15

adrian_haws
Not applicable

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.

Message 3 of 15

cindy_azuero
Not applicable

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
Message 4 of 15

matt_long
Not applicable
Accepted solution

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.

Message 5 of 15

matt_long
Not applicable

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.

Message 6 of 15

cindy_azuero
Not applicable

Thanks

0 Likes
Message 7 of 15

cindy_azuero
Not applicable

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

0 Likes
Message 8 of 15

matt_long
Not applicable

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.

Message 9 of 15

cindy_azuero
Not applicable

@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
Message 10 of 15

matt_long
Not applicable

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.

Message 11 of 15

cindy_azuero
Not applicable

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:

2680-delay-1-s.png

graph with delay 30 seconds:

2681-delay-30-s.png

0 Likes
Message 12 of 15

matt_long
Not applicable

Right, it's a bug with the drawing of the chart. The datapoints become so close together that they're less than a pixel between each one and so the computer doesn't render the line. If you zoom in to that chart you'll see the line appear. Over that length of time are the results that much different doing a larger time interval?

0 Likes
Message 13 of 15

cindy_azuero
Not applicable

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
Message 14 of 15

matt_long
Not applicable

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.

Message 15 of 15

jason_merschat1
Not applicable

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