question

Navid M avatar image
0 Likes"
Navid M asked Jeanette F commented

Conditional Storage and Retrival

Hello,

I have 10 storage rack and one source ( a global table like below):

The table has 3 columns, timestamp, ordernumber and total packs within an order. I want to store packs of each order in a different rack and the preference is to store it in a rack with more empty storage locations.

When the last item of an order arrive in the warehouse, I want to start retrive them.

Here is an example of table:

Unix TimeStamp Order Number Total_Packages_In_Order
1662054400 100 3
1662054404
101 4
1662054420
100 3
1662054430
102 2
1662054450
100 3

Ordernumber 100 has 3 packs, each pack to be stored in one rack, and by the time the last packs of this order arrives, I need to retrive the items from the warehouse.

I could not find any tutorial in Flexsim website for warehousing, appreciate help on this.

FlexSim 21.0.10
conditional deciderack storage
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Navid M, was Kavika F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Kavika F avatar image
0 Likes"
Kavika F answered

Hey @Navid M, here are some things you'll need to work out to achieve your desired outcome.

First, you'll need to have a way to keep track of Order Numbers and Racks - you could achieve this with a Global Table that you update with some Custom Code, something like this:

/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

Table rackLookup = Table("Rack Lookup");
int orderNumber = token.Item.labels["Order Number"].value;
int row = rackLookup.getRowByKey(orderNumber, "Order Number");
Storage.Object rack = rackLookup[row]["Rack"];
if (rack) {
  token.labels.assert("Rack", rack);
}
else {
  Storage.System system = Model.find("Tools/StorageSystem");
  int leastItems = 2147483647; // int max
  for (int i = 1; i <= system.storageObjects.length; i++) {
    Storage.Object tempRack = system.storageObjects[i];
    int numItems = tempRack.subnodes.length;
    if (numItems < leastItems) {
      leastItems = numItems;
      rack = tempRack;
    }
  }
token.labels.assert("Rack", rack);
rackLookup[row]["Rack"] = rack;
}

1670004447138.png

The Rack column will be updated based on the number of items currently in that Rack.

Then you'll need to have some sort of trigger to know when you're finished storing a specific order. This could be accomplished with another Table that keeps track of Order Number and total number of packages in that order (or you could do a calculation every time on that table you provided). Then you have a Event-Triggered Source for when an Item enters a Rack. You can increment a counter for each Item and Type in that same table, so it looks something like this.

1670005162034.png

and the Total value could be like this:

Table ArrivalTable = Table("Arrival Schedule");
Table TotalCount = Table("Total Count");
int total = 0;
for (int i = 1; i <= ArrivalTable.numRows; i++) {
  if (ArrivalTable[i]["Order Number"] == TotalCount[1]["Order Number"]) {
    total += ArrivalTable[i]["Num Packages in Order"];
  }
}
return total;

You could also just keep a hard-coded Total instead of calculating it each time.

Once your current count has reached the total, then you could spawn a token in another part of the Process Flow to trigger unloading of that item type.


1670004447138.png (4.0 KiB)
1670005162034.png (5.4 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.