question

Sebastian Hemmann avatar image
0 Likes"
Sebastian Hemmann asked Felix Möhlmann commented

Show available space of storage

Hi,

I´m looking for an easy way to show the available space in a storage system.

Something like x% of the storage is filled e.g.

Since I couldn´t find any Dashboards for tracked variables in the current version, it seems to be hard to add a "maximum" content line into a line graph or something similar.

Does anybody have a good idea?

@Jordan Johnson

FlexSim 20.2.3
flexsim 20.2.3fill level
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

·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Felix Möhlmann commented

The maximum can't always be calculated. You can have no maximum, where items can always successfully acquire a slot. You can also have the maximum depend on the items that appear. For example, supposed you limit slots by their available volume, and you put randomly-sized items in the rack. You could probably calculate a range for the maximum in that case. There are many other situations that make calculating a true maximum impossible.

If you want to count slots, here are two ways to do it:

Storage.system.querySlots("").length

or

int count = 0;
var objects = Storage.system.storageObjects;
for (int o = 1; o < objects.length; o++) {
    var bays = objects[0].bays;
    for (int b = 1; b <= bays.length; b++) {
        var levels = bays[b].levels;
        for (int v = 1; v <= levels.length; v++) {
            var slots = levels[v].slots;
            for (int s = 1; s <= slots.length; s++) {
                var slot = slots[s];
                if (slot.isStorable) {
                    // You may need to increment the count based
                    // on slot labels or something
                    count++;
                }
            }
        }
    }
}
// for a script window:
// return count;
· 8
5 |100000

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

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

@Jordan Johnson, thanks for pointing this out. What do you think could be a good way to set the maximum capacity manualy and show both - my maximum and the actual filling (e.g. number of boxes) in one dashboard?

0 Likes 0 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ Sebastian Hemmann commented ·

Here's one possibility:

ValueVsMax.fsm

The idea is to calculate the max, and then show that line on the chart. All of that is done in the stats collector. I used a "When the Value is Accessed" for the time column, and intentionally didn't finish the second row for the Max data. I do finish all other rows, so they only update when the row is added. That way, I only have two rows of data for the Max series.

0 Likes 0 ·
Sebastian Hemmann avatar image Sebastian Hemmann Jordan Johnson ♦♦ commented ·
Hi @Jordan Johnson, sadly the link is broken and I didn´t download the model until now. Please be so kind and upload the model again.
0 Likes 0 ·
Show more comments

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.