question

ivan avatar image
0 Likes"
ivan asked Felix Möhlmann commented

record of what comes into stock

Good evening, I have the following system with a stock (4 warehouses) that is found before the process. I need to keep a record of how many boxes are entering each store per hour, open any graph that will help me?

1680057331559.png

In the previous image you can see the warehouses from which I need to know how many products enter per hour

In the same way, I don't know if it is possible to make a joint graph of the four warehouses as shown in the following image.

1680058265490.png

My objective is to know how many products enter each warehouse per hour and how much it represents in percentages, considering that the union of the 4 warehouses is 100%.

I hope you can guide me please

I attach an example of my modelregistro de STOCK.fsm



FlexSim 22.1.0
almacenamiento
1680057331559.png (102.1 KiB)
1680058265490.png (161.1 KiB)
5 |100000

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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You can build a Statistics Collector that collects this information and have a dashboard chart show this information visually.

The attached model contains an example of how such Statistics Collector could work. (It also contains an example to get the input by hour (input over time), because I misread your question at first.)

If you haven't worked with Statistics Collectors before I would suggest to have a look at the respective documentation, so you can understand how the example functions.

https://docs.flexsim.com/en/22.1/Reference/Tools/StatisticsCollector/StatisticsCollector.html

registro-de-stock-fm.fsm

In the model only the raw number is used, but you can of course divide the input-per-hour-value by the total capacity to get a percentage value.


· 2
5 |100000

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

ivan avatar image ivan commented ·

Me pareció muy interesante y si implemento este ejemplo en mi proyecto, ya analicé la información correspondiente pero no entiendo al 100%, ¿podrías explicarme paso a paso cómo implemento los eventos y si es necesario editar los códigos?

1680188257413.png

No sé si este primer evento es para generar el primer gráfico, que es lo que me interesa implementar, ¿podría explicarme paso a paso cómo genero esta compilación estadística con sus respectivos eventos y cómo genero el gráfico?

1680188711518.png

Realmente me ayudaría mucho

0 Likes 0 ·
1680188257413.png (134.2 KiB)
1680188711518.png (257.4 KiB)
Felix Möhlmann avatar image Felix Möhlmann ivan commented ·

The event happens, as the name suggest, on model reset and then every 3600s/1h. Every time the event fires, the code in the Row Value(s) field is executed. You learn more about how row values work on the linked manual page in my original answer. In short: The function returns an array of values and for each element a new data row is created in the Statistics Collectors internal table.

The code reads the Input stat from the objects and stores it in a map label, so when the event fires the next time, the previous Input value can be read from there to calculate the difference the previous and current value - the input that happened in the meantime.

Both a reference to the object and the calculated difference are written to the row value and then used in the Columns tab to write this data to the table.

Below is a commented version of the code.

// Get an array of all objects from the group linked through the "Objects" label
Array storages = collector.Objects.as(Group).toFlatArray(); // Create row values in format [storage, last hour input] Array rowValues = []; // For each object in the array for(int i = 1; i <= storages.length; i++) {     Object storage = storages[i];     // Read the previously measured input value that is stored in the "QtyMap" label for this object     int prevInput = collector.QtyMap.as(Map)[storage];     // Get the current input statistic     int curInput = getstat(storage, "Input", STAT_CURRENT);     // Update the QtyMap label to the current value     collector.QtyMap.as(Map)[storage] = curInput;         // Push a reference to the object and the difference in input between last time and now to the row value array     rowValues.push([storage, curInput - prevInput]); } // Each entry in the row value will create a new row (Each entry is an array with two element) // These are accessible through "data.rowValue" when writing data to the column return rowValues;

You could also have the table view and labels tab open while the model is running to see how they change when the event fires.

capture.png

Note how the values for 10:00:00 are the difference between the previous values and what you see in the label map (which holds the Input stat value from the latest measurement, not necessarily in order).

0 Likes 0 ·
capture.png (20.8 KiB)
Diego Avila avatar image
0 Likes"
Diego Avila answered

Hi Ivan, you can add an Queue "Buffer" with a Max Content capacity of 1 before each Floor Storage:

1680108080909.png

Each "Buffer" will function as a counter to measure the amount of products that enters per Floor Storage.


Using an Output / Hour Dashboard and selecting each of the Buffers you will be able to represent the Input of each Floor Storage.

1680108534951.png

Additionaly, you can rename your Dashboard title and select the interval time you want.


I attatch you the model:registro-de-stock_1.fsm


1680108080909.png (349.8 KiB)
1680108534951.png (455.5 KiB)
5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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