question

j08j avatar image
0 Likes"
j08j asked j08j commented

How can I accurately send items to a specific slot on the rack?

I use the following code to define how items in the queue are processed and transported to the rack, but TASKTYPE_UNLOAD can only specify the transfer to the rack without explicitly specifying the transfer to a specific slot on the rack. How can I modify this code to accurately send items to a specific slot on the rack?

Queue.setProperty("TransportRef", "Object current = ownerobject(c);\n\
Object item = param(1);\n\
int port = param(2);\n\
Object destination = param(3);\n\
double priority = param(4);\n\
int preempt = param(5);\n\
\n\
/***popup:PushToList:listType=TaskSequence*/\n\
/**Push to Task Sequence List*/\n\
/***tag:showAdvanced*//**1*/\n\
\n\
if (true) {\n\
TaskSequence taskSequence = TaskSequence.create(assertattribute(current, \"stored\", 0), priority, preempt);\n\
\n\
taskSequence.addTask(TASKTYPE_TRAVEL, current, NULL);\n\
taskSequence.addTask(TASKTYPE_LOAD, item, current, port);\n\
taskSequence.addTask(TASKTYPE_BREAK, NULL, NULL);\n\
taskSequence.addTask(TASKTYPE_TRAVEL, destination, NULL);\n\
taskSequence.addTask(TASKTYPE_UNLOAD, item, destination, opipno(current,port));\n\
string listName = \"TSList1\";\n\
List(listName).push(taskSequence, 0);\n\
current.centerObjects[1].message(0.01,current);\n\
}\n\
return 0;\n\
");

model.fsm

Thank you.

FlexSim 24.0.2
queueflexscriptrackcoding
model.fsm (42.8 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.

1 Answer

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

You already have code for the source that feeds directly into the rack to assign a random slot to the exiting item.

int i = duniform(1, Bay, 1);\n\
int j = duniform(1, Level, 1);\n\ int k = duniform(1, Slot, 1);\n\ Storage.Item(item).as(Storage.Item).assignedSlot = current.outObjects[1].as(Storage.Object).getSlot(i, j, k);\n\

You can do the same for the items transported by ASRS.

· 5
5 |100000

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

j08j avatar image j08j commented ·
Queue.setProperty("TransportRef", "Object current = ownerobject(c);\n\
Object item = param(1);\n\
int port = param(2);\n\
Object destination = param(3);\n\
double priority = param(4);\n\
int preempt = param(5);\n\
\n\
/***popup:PushToList:listType=TaskSequence*/\n\
/**Push to Task Sequence List*/\n\
/***tag:showAdvanced*//**1*/\n\
\n\
if (true) {\n\
TaskSequence taskSequence = TaskSequence.create(assertattribute(current, \"stored\", 0), priority, preempt);\n\
\n\
taskSequence.addTask(TASKTYPE_TRAVEL, current, NULL);\n\
taskSequence.addTask(TASKTYPE_LOAD, item, current, port);\n\
taskSequence.addTask(TASKTYPE_BREAK, NULL, NULL);\n\
taskSequence.addTask(TASKTYPE_TRAVEL, destination, NULL);\n\
int i = duniform(1, Bay, 1);\n\
int j = duniform(1, Level, 1);\n\
int k = duniform(1, Slot, 1);\n\
Storage.Item(item).as(Storage.Item).assignedSlot = current.outObjects[1].as(Storage.Object).getSlot(i, j, k);\n\
taskSequence.addTask(TASKTYPE_UNLOAD, item, destination, opipno(current,port));\n\
string listName = \"TSList1\";\n\
List(listName).push(taskSequence, 0);\n\
current.centerObjects[1].message(0.01,current);\n\
}\n\
return 0;\n\
");

I've tried this code before, but I couldn't simulate the model successfully. It stops when it tries to execute the action of placing items from the queue into the rack.

model.fsm

0 Likes 0 ·
model.fsm (42.9 KiB)
Felix Möhlmann avatar image Felix Möhlmann j08j commented ·
"Bay", "Level" and "Slot" are not defined at that point in the code. I only copied part of the source's code to highlight the relevant part: Determining the bay, level and slot ID and assigning the slot to the item.

I assumed you'd use labels to assign the items to specific slots, not use random number distributions.

The "transportdispatcher" variable node is also currently not toggled as FlexScript in your model.

0 Likes 0 ·
j08j avatar image j08j Felix Möhlmann commented ·

Is there a way to define "Bay", "Level" and "Slot" in this code?

0 Likes 0 ·
Show more comments