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.

  1. treenode activity = param(2);
  2. Token token = param(3);
  3. treenode processFlow = ownerobject(activity);
  4.  
  5. int num = Group("MyOperators").subnodes.length;
  6. Object obj;
  7. string labelName = "idleOps";
  8.  
  9. for(int i = 1; i <= num; i++){
  10. obj = ownerobject(Group("MyOperators").subnodes[i].value);
  11. if(obj.stats.state().valueString == "idle"){
  12. Token newToken = Token.create(NULL, getactivity(processFlow, "Breathe"), 1);
  13. newToken.labels.assert(labelName).value = obj;
  14. }
  15. }

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.