How to determine process times by the object name?

How to determine process times by the object name?

wojciech_p
Not applicable
19 Views
3 Replies
Message 1 of 4

How to determine process times by the object name?

wojciech_p
Not applicable

[ FlexSim 17.1.1 ]

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.

Accepted solutions (1)
20 Views
3 Replies
Replies (3)
Message 2 of 4

kari_payton
Not applicable
@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

Message 3 of 4

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

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

Message 4 of 4

wojciech_p
Not applicable

Thank you all very much!

0 Likes