question

Liam J3 avatar image
0 Likes"
Liam J3 asked Liam J3 commented

rackrestoreitem() and restored flowitem

rackrestoreitem() command always restores the last flowitem from the FlowItemBin (sub-node specified by binrank).
Wouldn't it be right to select the appropriate flowitem to match the command parameters of bay, level, position and to restore the flowitem to rack by default functionality?
That's my opinion.

question2-rackrestoreitem-restored-item.fsm

FlexSim 16.0.9
rackrestoreitem
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

Braydn T avatar image
0 Likes"
Braydn T answered Liam J3 commented

Hey @Liam J3

rackrestoreitem() does not actually "restore" an item. It just creates a new item in whatever area you specify. FlexSim does not save the information of deleted items. In order to save the last item deleted I would create a global variable called lastType or something similar, and in the code before you delete the item change the value to the value of that object. This is the first variable you put into rackrestoreitem().

I hope this answers your question! Please tag me @Braydn T if you need any more clarification.

· 3
5 |100000

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

Braydn T avatar image Braydn T commented ·

Hey @Liam J3

Did this answer help you? If so, could you please accept his answer? If not, could you let us know what else we can do to help you? Thanks!

0 Likes 0 ·
Liam J3 avatar image Liam J3 Braydn T commented ·

I have no further questions about this. I wanted to post this at FlexSim > Development space,
but this was posted at Software & Simulation Questions.
Thank you.

0 Likes 0 ·
Liam J3 avatar image Liam J3 commented ·

@Braydn T

I think as follows.
- rackrecycleitem() does moving flowitem into flowitem bin.
- rackrecycleitem() does not destory flowitem.
- rackrestoreitem() does moving flowitem from flowitem bin.
and the moved flowitem is the last flowitem of flowitem bin.

in my uploaded sample model,
- Source2 had set flowitem's label "ua_id" to unique integer value from 1 to 100.
- Rack3's messagetrigger of case 2 :
restore flowitem at cell[2,2]. the restored flowitem's "ua_id" value is 100.
the last flowitem created at source has "ua_id" value of 100.
and the flowitem of "ua_id" 100 is the last flowitem of flowitem bin.
- Rack3's placeinbay and placeinlevel :
the first flowitem entered into rack had located at bay 1, level 1.
- Rack3's messagetrigger of case 3 :
recycled flowitem of bay 1, level 1 is the first entered flowitem.
and the flowitem has recycled (moved) into flowitem bin at the first.
so I found flowitem as rank(tmp, 1) //code line 19 (this is sample finding flowitem)
and set the flowitem rank last.
and then restore flowitem at bay 1, level 1.
the restored flowitem has "ua_id" value of 1.
so I think that rackrecycleitem() does moving flowitem into flowitem bin,
and rackrestoreitem() does moving flowitem from flowitem bin,
and restored flowitem is the last flowitem in flowitem bin.

0 Likes 0 ·