question

Tzu Hsuan C avatar image
0 Likes"
Tzu Hsuan C asked Jeanette F commented

Give item an specific ID

Hi,

Recently I have a problem with giving item an specific ID.

Is there any way to give item an ID number whenever a item is created by Source? I hope I can record these item's ID number together with their entering and leaving time from stations or transporters to Statistics Collectors, so that I can track each item and do some calculation.

Currently my way of giving ID to every item is: Source > Triggers > On Creation > Data > Set Label.

But I have problem with Value, what I want to do is let 1st item ID=1, then for later coming item ID = previous ID + 1.

Maybe I need a variable first, and use the value of variable to tell what next coming ID should be.

There are Variable and Attribute concepts in other simulation software. I would like to ask what is correspond to such concepts in FlexSim?

Thank you!

FlexSim 20.2.3
flexsim 20.2.3item creation
label.png (39.4 KiB)
· 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.

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

Each item is unique in a model. This is true to every object in FlexSim, too. There are two commands, which can convert a reference, pointer and thing into a number and a number identification back into a pointer reference. They are tonum(thing or pointer) and tonode(num). Because of this the tracking of items works over a model run time. Even if you put an item into a list and you see a reference which describe a path to it, this path changes automatically if the item moves in your model. The item literally path is not a string it is still a pointer.

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
0 Likes"
Jeanette F answered

Hello @Tzu Hsuan C,

You can set the label by referencing the output of the source since it increments with each flowitem released. In my example model it starts from 0 but you can insert a +1 for it to start from 1.

Set incrementing Label.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.