question

j08j avatar image
0 Likes"
j08j asked j08j commented

How to make the ASRS place items in the racks on both the left and right sides?

If I have two racks as different destinations, how can I modify the code to make the ASRS travel to either of the racks?

1720107085211.png

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\
Object destination1 = current.outObjects[2];\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\
");


FlexSim 24.0.2
queuetransportflexscriptasktype_travel
1720107085211.png (14.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.

1 Answer

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

The "Use Transport" code you show here already gets the destination passed into it. You have to modify the "Send to Port" option of the queue because that is where the routing happens.

· 11
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 ·


I see, but even though I have set the queue's "send to port" to "random port", it still only sends items to one of the racks.

1720150618266.png

model.fsm

0 Likes 0 ·
1720150618266.png (4.2 KiB)
model.fsm (56.3 KiB)
Felix Möhlmann avatar image Felix Möhlmann j08j commented ·
It does send the fourth and fifth item to the other rack. But since that rack does not have the "Use Transport" option set the items move to the sink immediately.
0 Likes 0 ·
j08j avatar image j08j j08j commented ·

Got it. Now I have another question. I have set the TransportRef for both racks, but the items placed on the rack in the front cannot be taken down. What could be the problem? (Originally, it was supposed to perform extraction or placement actions according to the 0, 1 array displayed in the output console.)model.fsm

0 Likes 0 ·
model.fsm (55.8 KiB)
Felix Möhlmann avatar image Felix Möhlmann j08j commented ·

The "bound" list field is only 0 if the load task happens at the first rack in the model. (Both racks have the same name, "Model.find("Rack")" will always find the first one.

1720164233984.png

I would suggest to set "bound" based on a label on the origin or destination object. Using names for such things will quickly lead to such errors when changes are made to the model.

0 Likes 0 ·
1720164233984.png (17.3 KiB)
Show more comments