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 10-12-2009
zhang xin zhang xin is offline
Flexsim User
 
Join Date: Dec 2008
Location: China
Posts: 136
Downloads: 147
Uploads: 0
Thanks: 81
Thanked 6 Times in 6 Posts
Rep Power: 150
zhang xin is on a distinguished road
Default why 0.1?

Hi, in operator's QueueStrategy trigger, there is an option "Prioritize by distance". It has the following code:

treenode station = gettaskinvolved(tasksequence,taskrank,involvednum) ;
double dist = distancetotravel(current, station);
double inversedist = 0;
if((getnroftasks(tasksequence) < gettotalnroftasks(tasksequence) || !onlypartial) && dist != GLOBAL_UNREACHABLE)
{

if(dist > 0)
{
inversedist = 0.1 / dist;
}
else
{
inversedist = 0.1;
}

}
return inversedist;

What I want to know is why use 0.1?

If dist is 0, then inversedist will be 0.1 . This means that it has a lower priority than 0.5 dist (in this case, inversedist will be 0.2). But in fact 0 dist should have higher priority.

Maybe I misunderstand something, any idea?
  #2  
Old 10-13-2009
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

Hi Zhang,

I think this is about precision. You can't use 0/dist. With 0.1 you get a small error. You can get a higher precision with 0.000001 but at bottom it doesn't make much difference.

Greetings

Carsten
The Following User Says Thank You to Carsten Seehafer For This Useful Post:
zhang xin (10-13-2009)
  #3  
Old 10-13-2009
zhang xin zhang xin is offline
Flexsim User
 
Join Date: Dec 2008
Location: China
Posts: 136
Downloads: 147
Uploads: 0
Thanks: 81
Thanked 6 Times in 6 Posts
Rep Power: 150
zhang xin is on a distinguished road
Default

Hi, Carsten, thank you.
Maybe I am not expressing it clearly.

Iif dist is computed as 0, then this TS should have highest priority (eg inversedist) because it is the nearest. But according to the code, it's priority (eg inversedist) will be computed as 0.1. This priority is not higher enough.
The Following User Says Thank You to zhang xin For This Useful Post:
Carsten Seehafer (10-13-2009)
  #4  
Old 10-13-2009
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

Hi Zhang,

I have a closer look at the QueueStrategy. The station is the travel target to unload the item. Normally it doesn't make sense to have a source and a target at the same position and use an operator for this transport (maybe the source is elsewhere). But I think you're right. If the distance to travel is 0 then it should be the highest priority.

Greetings

Carsten
  #5  
Old 10-13-2009
zhang xin zhang xin is offline
Flexsim User
 
Join Date: Dec 2008
Location: China
Posts: 136
Downloads: 147
Uploads: 0
Thanks: 81
Thanked 6 Times in 6 Posts
Rep Power: 150
zhang xin is on a distinguished road
Default

Sorry, in my project, I have changed the station to point to the source(not target).
Should I write:

if(dist > 0)
{
inversedist = 0.1 / dist;
}
else
{
inversedist = 100000;
}
  #6  
Old 10-13-2009
Carsten Seehafer's Avatar
Carsten Seehafer Carsten Seehafer is offline
FlexSim Geek
 
Join Date: Oct 2008
Location: Ritterhude, Deutschland
Posts: 230
Downloads: 45
Uploads: 1
Thanks: 474
Thanked 320 Times in 143 Posts
Rep Power: 379
Carsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud ofCarsten Seehafer has much to be proud of
Default

Your solution should work
The Following User Says Thank You to Carsten Seehafer For This Useful Post:
zhang xin (10-13-2009)



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.