question

Wojciech P avatar image
1 Like"
Wojciech P asked Wojciech P answered

How to determine process times by the object name?

I would like to make a model, where process time will be chosen by the name of box which is going to multiprocessor? For example box named "1" should be 10 seconds in multiprocessor, box "2" 15 seconds; etc.

FlexSim 17.1.1
timeprocess timecommandsprocesscase
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
1 Like"
Joerg Vogel answered Joerg Vogel edited

You can set the process time indirectly over the index of an array of the item names. It is recomented to start a name with a character that isn't a number.

Here the code for the Process Time function:

double procTime = 0.0; // initialize procTime;

Array parts = ["Part1", "Part3", "Part2"];// array of Part names
int index = parts.indexOf(item.name);
switch(index){
    case 1: // Part1
        {
            procTime = 11.1;
            break;
        }
    case 2: // Part3
        {
            procTime = 12.3;
            break;
        }
    case 3: // Part2
        {
            procTime = 14.4;
            break;
        }
    default: // not element of the array parts
        procTime = 10.0;
}

    
return procTime;

You can add more elements to the array. process-time-by-item-name.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.

Kari Payton avatar image
2 Likes"
Kari Payton answered
@Wojciech P

There are a few ways you can do this. One is to set a label on the items exiting the source. Then have the processor read the item label and assign the processing time.

1. On the Source go to the Triggers Tab - On Creation - Set Label

In the example I created a label called "itemType".

2. On the Processor go to Processor Tab - Process Time - Values by Case.

For the case, reference it to token.itemType. Here you can put the options for the different processing times based on the item type. timebyitemtype.fsm


timebyitemtype.fsm (15.5 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.

Wojciech P avatar image
0 Likes"
Wojciech P answered

Thank you all very much!

5 |100000

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