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 04-18-2008
Alexandre Ouellet Alexandre Ouellet is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 9
Downloads: 1
Uploads: 0
Thanks: 2
Thanked 0 Times in 0 Posts
Rep Power: 0
Alexandre Ouellet is on a distinguished road
Default How to dispatch a preempting TS immediately

Hello,

In my model, a preempting TS is given to a dispatcher. I want it to immediately dispatch the TS to the TE instead of queueing it. I know I have to specify that in the Pass To function, but I don't know how to do that.
Did someone already does that?

Thanks

Alex
  #2  
Old 04-18-2008
Brandon Peterson's Avatar
Brandon Peterson Brandon Peterson is offline
The Flexsim Consultant
 
Join Date: Jul 2007
Location: Salt Lake City, Utah
Posts: 382
Downloads: 29
Uploads: 6
Thanks: 192
Thanked 516 Times in 235 Posts
Rep Power: 490
Brandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant futureBrandon Peterson has a brilliant future
Default

Alexandre,

If the PassTo trigger returns a port number for the task executer that is to recieve the task sequence then the task sequence will be passed on immediately. If the PassTo trigger returns a 0 then the task sequence will be queued up.

So, you need to make sure that your PassTo trigger on the dispatcher returns a value other than 0 when you send it a preemptive task sequence.

Brandon
__________________
thats not normal.
  #3  
Old 07-18-2008
Cliff King's Avatar
Cliff King Cliff King is offline
Vice President Technical Services
 
Join Date: Jul 2007
Location: Utah
Posts: 272
Downloads: 158
Uploads: 14
Thanks: 102
Thanked 304 Times in 110 Posts
Rep Power: 412
Cliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud ofCliff King has much to be proud of
Default Passing only Preemptive TaskSequences Immediately

Here's some code I have used successfully in a PassTo field of a Dispatcher to pass preempting tasksequences on immediately (so that they will actually get a chance to preempt another tasksequence), but queue up all non-preempting tasksequences (and possibly queue up preempting tasksequences that can not find a downstream TE that is either available, working on a non preempting tasksequence or working on a preempting tasksequence with lower priority). This entire code can be copied into a PassTo field.

Code:
treenode tasksequence = parnode(1);
treenode current = ownerobject(c);
/**Pass Preemptive TaskSequences to the Shortest Queue Having No Preempting Tasks of Equal or Higher Priority. All Other TaskSequences Queue-Up for First Available Object.*/
if(getpreempt(tasksequence) == 0)
    return 0;
int minindex = 0;
int curmin = 1000000;
for(int index = 1; index <= nrop(current); index++)
{
   treenode curobj = outobject(current,index);
   if(objectexists(curobj))
   {
     int curcontent = content(gettasksequencequeue(curobj));
     treenode activets = gettasksequence(curobj,0);
     if(curmin > curcontent
        && (!objectexists(activets) || !getpreempt(activets) || getpriority(activets) < getpriority(tasksequence))
     )
     {
         curmin = curcontent;
         minindex = index;
     }
   } 
}
return minindex;
One final note, in working with preempting tasksequences recently, I discovered a bug when using preempting tasksequences and connecting the TE's output ports back into a dispatcher in an attempt to redistribute bumped tasksequences to another TE. This is an obscure bug that most people will not run into, but a fix has been found and will be taken care of in the next Flexsim release.
The Following User Says Thank You to Cliff King For This Useful Post:
shafizad (08-28-2010)



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.