ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Q&A Using Flexsim and building models |
#1
|
|||
|
|||
Multiple operators at different locations performing a single processor
Hi,
Im trying to get multiple operators to perform a process (at a processor) but not all stand at the same location and was hoping someone could help me out. The approach i tried was using a traffic controller of the path to the first processing location and setting mutual exclusion to 1, to see if the second operator went to the second processing location (model attached). It succeeded in stopping any more operators entering that particular processing location, but they did not continue on to an alternative. I also tried a similar approach by closing edges in the on continue trigger of the "divert" node but had the same effect. I suspect this is because operators by default travel by the shortest path (as documented), i would like to somehow change this to shortest AVAILABLE path. Regards Paul |
#2
|
|||
|
|||
Doing 'calloperator' in your own code
Paul,
There's nothing to stop you creating the task sequences for the operators yourself, and then you can send each of them to different locations - which could be network nodes for example. The code here is not complete, and is taken from the callprocessoperators and calloperator functions - but if you need a fully working example, just let me know and I'll put one together. Code:
#define OPERATOR_STOP_ID 100002 for (int index = 1; index <= nrofops; index++)stopobject(<processor>,STATE_WAITING_FOR_OPERATOR, OPERATOR_STOP_ID, priority);treenode newts = createemptytasksequence(<dispatcher>, priority, preempt); inserttask(newts, TASKTYPE_MILESTONE, NULL, NULL, 3); inserttask(newts, TASKTYPE_TRAVEL, <travellocation[index]>, NULL); inserttask(newts, TASKTYPE_STOPREQUESTFINISH, <processor>, NULL, 0, OPERATOR_STOP_ID); inserttask(newts, TASKTYPE_UTILIZE, item, <processor>); dispatchtasksequence(newts);} The only problem is that the involved doesn't then get set on the flowitem so you may need to send a message (0 delay) to set it to the dispatcher by doing the equivalent of : Code:
setnodenum(rank(itemtype(item),QUEUENODERANK_INVOLVED),tonum(dispatcher)) |
#3
|
|||
|
|||
Model example
Here it is in operation using the getnetnode function to determine where to send the operators, and with two processors so that they move from one to the other. The code is in the processdispatcher and messagetrigger nodes of each processor.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Paul Dowling (06-03-2008) |
#4
|
|||
|
|||
Thanks Jason. That works perfectly.
Wondering did you mean requestoperators instead of calloperators (can't seem to find either of the commands starting with call)? Also, how does one view the contents of these commands (other than just using the command index)? That would allow you to create your own custom "versions" of functions (using usercommands or something) very quickly and easily... Last edited by Paul Dowling; 06-03-2008 at 10:45 PM. |
#5
|
|||
|
|||
The callprocessoperators is a method of the Processor class found within library tree. It uses calloperator in a similar way to requestoperators does, except that it records which dispatcher was used on the flowitem in order to release the operators when the job is done :- when you use requestoperators you need to code the freeoperators part yourself when the process is finished. Because you wanted the operators to go to specific nodes and yet do a TASKTYPE_STOP_REQUEST_FINISH on the processor once they arrive, you can't use requestoperators.
The calloperator command is one of the globalC++ commands found in the exec part of the tree (not all commands are listed there). Note that we could have used freeoperators instead of recording the dispatcher on the item, I just did it that way so that it behaves more like a default processor. Ideally we would be able to do this in the same trigger and avoid sending the message - I'll put it on the development wish list. Glad I could help. |
Thread | Thread Starter | Forum | Replies | Last Post |
can I use an edit box entry to update multiple labels? | KelvinHo | Q&A | 10 | 03-28-2008 07:17 AM |
Problem with Processor Output | avinash | Q&A | 2 | 03-26-2008 09:19 AM |
Multi-Processor Help | Davie Stomp | Q&A | 3 | 01-27-2008 02:23 PM |
Operators on Multiple Networks | Nico Zahn | Q&A | 0 | 10-10-2007 03:02 AM |