question

Andrea F avatar image
0 Likes"
Andrea F asked Andrea F answered

Schedule retrieval of orders in different dates according to the OrdersTable

Hello everyone,

I would like to ask how can i schedule a retrieval system in different dates in the model according to the dates written in the OrdersTable.

sarner-holz.png

I would like to simulate the retrieval of the orders(rows) according to their actual date. How can i schedule that ? My idea is to put a wait time activity in order that the model starts at the date read by a label activity with the Global Table LookUp. Do you have any solution regarding this problem?

sarner-holz-final-floor-1-jf-2-fm.fsm

Thak you in advance

FlexSim 19.1.2
warehouselogisticswarehouse optimization model
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

Hi @Andrea F,

I added a delay activity at the bottom of the process flow. The code in it converts the row header of the next OrdersTable row into FlexSim time and then delays the token until that time reached.

The code is the following:

// Get the DateTime string from the OrdersTable
string Table_DateTime = Table("OrdersTable").getRowHeader(token.nRow);

// In order to be converted into a number, 
   the string has to be of the format defined in the model settings
// Extract the time and date part and switch them around in a new string
string Time = Table_DateTime.slice(12, 20); // HH:mm:ss
string Date = Table_DateTime.slice(1, 11); // yyyy-mm-dd
string Switched_DateTime = Time + " " + Date; // HH:mm:ss yyyy-mm-dd

// Now convert the string into a DateTime number
Variant Model_DateTime = convert(Switched_DateTime, DATETIME_STR, FS_DATETIME);

// Return the number of seconds until that time is reached, 
   or zero if time was already reached
return Math.max(Model.getTime(Model_DateTime) - Model.time, 0);

To make it easier to bring the row header into the correct format I changed the date delimiter to be "-" rather than "/" in the model settings.

sarner-holz-final-floor-1-jf-2-fm_1.fsm


5 |100000

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

Andrea F avatar image
0 Likes"
Andrea F answered

Thank you @Felix Möhlmann

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.