Hello,
I have a model that uses a GUI to build the entire model. Because of this, i need quite a bit of flexibility. First, I have the model build processes based on how many the user defines. I also ask the user to choose how many operators the model will have. Based on how many are chosen, the model builds the operators.
I need to assign these operators to all the processors and have the number of processors for the process dependent on item from a global table lookup.
//Builds the operators for (int ops=1; ops<=MTs; ops++) { createinstance(node("taskexecuters/Operator", library()), model()); treenode Mechanic = last(model()); setloc(Mechanic, ops,-10,0); setname(Mechanic, concat("Mechanic", numtostring(ops,0,0))); }
Then I have all the processors built and need the above operators Center attached to all the processors, but only some operators are called depending on the item type in that process.
createinstance(node("/fixedresources/Processor", library), model()); treenode bayrepair = last(model()); setname(bayrepair, "BayRepair"); setloc(bayrepair, 0, y, 0); contextdragconnection(Checkin, bayrepair, "A"); string ProcessTime = "treenode current =ownerobject(c); treenode item = parnode(1); return gettablenum(\"ProcessTimes\",getitemtype(item),2);"; setvarstr(bayrepair, "cycletime", ProcessTime); setvarnum(bayrepair, "nrofprocessoperators", gettablenum("ProcessTimes", getitemtype(item), 3)); contextdragconnection(mechanic, bayrepair, "S");
Basically, via code, I need to assign all the operators in the model to all the processors, but only some operators are called for work depending on the item type that is formatted from the global table.
Thanks for the help! I'm a bit new to this programming and FlexSim, but hope to be able to give help soon!