question

ClaraS avatar image
0 Likes"
ClaraS asked Jonah K answered

Calling Operators to Station only if they're idle

I want to call all operators in a certain group to a multiprocessor if they're idle. The station would have a minimum number of operators necessary for the task, but if there are other operators just sitting there, I want them to help at that multiprocessor. Is this possible?

FlexSim 23.2.0
multiprocessoroperator assignmentmultiple operators
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

·
Jonah K avatar image
0 Likes"
Jonah K answered

I was able to do this with a process flow custom code.

treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

int num = Group("MyOperators").subnodes.length;
Object obj;
string labelName = "idleOps";

for(int i = 1; i <= num; i++){
obj = ownerobject(Group("MyOperators").subnodes[i].value);
if(obj.stats.state().valueString == "idle"){
Token newToken = Token.create(NULL, getactivity(processFlow, "Breathe"), 1);
newToken.labels.assert(labelName).value = obj;
}
}

When the code is fired, it looks for all operators in "MyOperators" group that have the state = "idle". For each one, it creates a token with a label "idleOps" that contains the path of the operator. All of these new tokens are sent to the Breathe activity.

I created a model that uses this custom code to pull all operators that are idle to help with the multiprocessor when an item arrives at the multiprocessor.

UseIdleGroup.fsm


useidlegroup.fsm (49.3 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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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