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 |
#1
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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
|
||||
|
||||
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
|
|||
|
|||
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; } |