ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 06-02-2008
Paul Dowling Paul Dowling is offline
Flexsim User
 
Join Date: Aug 2007
Location: Sydney, Australia
Posts: 42
Downloads: 14
Uploads: 0
Thanks: 12
Thanked 4 Times in 4 Posts
Rep Power: 161
Paul Dowling is on a distinguished road
Default 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
Attached Files
File Type: zip multiple_process_locations.zip (72.8 KB, 365 views)
  #2  
Old 06-03-2008
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default 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);
}
I'm pretty sure you can put this on the process dispatcher trigger and return 0 instead of a valid dispatcher pointer.

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))
Suggestion: Perhaps there should be -1 return check to indicate that we've already done the operation within the processdispatcher trigger, to avoid the item's involved node being set to NULL.
  #3  
Old 06-03-2008
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default 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.
Attached Files
File Type: zip multiple_process_locations2.zip (58.8 KB, 325 views)
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Paul Dowling (06-03-2008)
  #4  
Old 06-03-2008
Paul Dowling Paul Dowling is offline
Flexsim User
 
Join Date: Aug 2007
Location: Sydney, Australia
Posts: 42
Downloads: 14
Uploads: 0
Thanks: 12
Thanked 4 Times in 4 Posts
Rep Power: 161
Paul Dowling is on a distinguished road
Default

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  
Old 06-04-2008
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.