question

Bruno T2 avatar image
1 Like"
Bruno T2 asked Phil BoBo commented

Output per hour

Hello,

i'm currently using FlexSim for the first time and i'm trying some simples exemples to figure out what can I obtain from Flexsim but I am already struggle to obtain very basics stuff from the sumilation.

I'm running a little system composed by a source, a queue, a processor, a sink and some conveyors to connect it all.

Basically what i'm trying to get is the output per hour from the processor to the sink BUT unfortunattly after few hours of tries, i'm not getting the expected result.

I am aiming to get a chart (time chart or bar chart) which show me for every hour of the day, how many boxes are outgoing from the processor but what i'm getting is always the cumulation per hour (since the begening to the current hour) of all outgoesed boxes.

I already tried to check "Discard old data" with a keep newest value at 3600 seconds but it doesn't seem to affect the result produced.

I'm sure there is an easy way to get what i'm looking for so, anyone can help me ?

FlexSim 17.1.2
output per hour
5 |100000

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

1 Answer

Clair A avatar image
3 Likes"
Clair A answered Phil BoBo commented

Hello Bruno,

Attached I've built a model similar to the one proposed by @phil.bobo, with an alternative solution for the graph.

On the processor, create a label called previousOutput, and check Automatically Reset.

In the dashboard, drag & drop a Content vs Time graph. Change the graph name as you like. Then add the Processor in the Objects tab:

In the Statistics tab, remove the Current Content statistic and add a Custom one:

And copy paste this code:

  1. Object resource = i;
  2. int value = resource.stats.output.value - resource.previousOutput?;
  3. resource.previousOutput = resource.stats.output.value;
  4.  
  5. if(time > 0){
  6. treenode graph = ownerobject(c);
  7. treenode timedata = getvarnode(graph, "timedata");
  8. double timeinterval = getvarnum(graph, "timeinterval");
  9. addbundleentry(timedata, time - timeinterval, value);
  10. addbundleentry(timedata, time, value);
  11. }
In the General tab, change the interval to 1 hour and the time units also to 1 hour.

With this method you get a graph with stair steps for each hour:


1.png (5.4 KiB)
2.png (5.6 KiB)
1.png (5.4 KiB)
3.png (12.7 KiB)
4.png (2.9 KiB)
5.png (11.1 KiB)
· 3
5 |100000

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