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 07-14-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default Choosing the lower queue

Dear,

I have a simple objective, a model is tipically to aplication the queue teory, i don't know if is possible do this with the standard functions of FlexSim.

Check the description of my model:

-The model is composed by 10 TE's, by it self is responsable to take the product from the First Sector to the Second Sector.
-The First Sector is composed by 4 Load points (Queue's), wich one has a inexhaustible and continuously source and is allowed in maximum 2 TE's between "Wainting point1" and Queue's.
-The Second Sector is composed by only 2 Unload points(Queue's), and is allowed in maximum 2 TE's between "Waiting point2" and Queue's.

When TE's arriving in Waiting Points, they need to go to the empty terminal or where the queue is lower.

The attached file show this better. At first, it seems to happen, but over time realized that does not happen, the TE only obey the standard arrival, and this create a big queue in occuped terminals while the others are empty.

I've tried to use the standard functions of FlexSim, but does not solved (I don't know if I used the right functions), after I tried to use some conditions in "Pass To" in Dispatcher, the logic seems happen, but the Dispatcher uses only one TE.

Best regards
Attached Files
File Type: zip Choosing the lower queue.zip (82.8 KB, 174 views)
  #2  
Old 07-14-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Flavio,

the main issue with your model is, that Flexsim determines the tasksequence as soon, as a flowitem to load and a destination become available. So the decision is met, when the dispatcher hasn´t even started to move to waiting point one. On his way to that the situation could change.
I think, the way to go would be to create only a traveltask to waiting point 1 in the flow tab of the queues in sector 1.
As soon as the Task executer reaches waiting point 1 decide which flowitem from which queue to load on arrival trigger and create the tasksequence there.

But this solution would lead you into custom task sequences...

I didn´t change your model to that, since I am not sure if this is the way you want to go, although custom task sequences are Flexsim standard and can be created through the GUI in Tools.

Good luck.

Ralf
Flexsim Germany
The Following 3 Users Say Thank You to RalfGruber For This Useful Post:
Tom David (07-15-2010)
  #3  
Old 07-16-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default

Hi Ralf,

Thanks by the light. I followed your advice, but I'm facing, initially four problems:

First: To set the maximum number of travelers in Areas (between waiting points and Queues), I used the Global Table, but when I run the model, always enter one traveler more in Area (example: if I set 1, enter 2). I tried to limited the number of travelers by the TrafficControl, but in this way the model has stoped!!!

Second: In the last condition (Localized in OnArrival in WaitingPoint1), when the number of travelers is exeeded, the last traveler stop, wait 3 seconds in state "x" and run the logic again, but I don't know how to execute the logic again, that's why the traveler stop, assumed the state "x" and stay that all the time!!rsrs

Third: The programming created in OnArrival in "WaitingPoint2" is executed only the second time that the traveler pass there instead of the first. The last task in the "waiting point1" is to travel to the "waiting point2", the logic wouldn't finished when the taveler arrives in the destination?? And should not assumed the logic created in "waiting point2" in this time??

Fourth: I believe that this is the most easily question. How to make a reference to the "Item" by the "waiting point2" ??

Thanks
Attached Files
File Type: zip Choosing the lower queue.zip (99.7 KB, 150 views)
  #4  
Old 07-16-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Flavio,

let me make some remarks on your model and the questions:

1. You use OnArrival and Custom Draw Code in waiting point 1 to update the number of travelers. Be aware, that OnArrival is called twice for each traveler reaching the network node, once for network travel and once for offset travel. You can use the nodeedges to identify each. Have a look into the documentation for further explaination. The Custom Draw Code should NEVER be used for calculations which have an impact on the simulation run itself, just because its execution depends on the screen refresh rate. So don´t do any calculation here, just care about animation.
By the way, what did not work in controlling the areas by traffic control?

2. Instead of executing the logic on a trigger on waiting point one, make it a user command. So you can execute it when a traveler arrives at waiting point one and from network nodes 1 to 4 whenever a traveler leaves one of them again. That way you do not need to check every 3 seconds or whatever, if a queue becomes available. Just let the network nodes at the queues tell you.

3. Here applies the same as said in point 1. You can use the tree and look into the nodes activetasksequence and tasksequencequeue to see, which tasksequences are generated. Be aware of doubble execution of OnArrival!

4. If you want to reference the item carried by the traveler use "first(traveler)".

I still didn´t fully understand, how you want your model to work:
- you want a max of two travelers on each path to Queue1 and 4 (do you want to move to the queue qith the highest no of flow items in it first or doesn´t this matter?)
- after a traveler picked up an item at a queue 1 to 4 and leaves, the next traveler can leave waiting point 1 for this queue
- the travelers move to waiting point 2
- same algorithem as above?

Hope that helps a bit

Ralf
Flexsim Germany
  #5  
Old 07-16-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default

Hi Ralf,

1. Thanks for the explanation about the Custom Draw Code, I used that only to follow the status of areas by Labels. I didn't controlling the areas by TrafficControl because when I activate that the travelers stop in waiting point1 and only leave that when the first traveler leave the queue1, I don't know why!!

2)Ok, althought I don't know how to do this I'll look into, do you have any material to recommend??

3)...

4)I've tried to use this, but unsuccesfully, the error is the same. See attached

I want a max of two travelers on each path to Queue 1 and Queue4, and as the travelers load item and leave the area, the traveler waiting to load choose the Queue with lower queue and go there to load (imagine one bank queue with 4 terminals, the first free terminal will be the choosen by a client). In waiting point 2 the same process happen, if the second TE arrives and the Queue5 are busy, he go to Queue6.

Flavio
Attached Thumbnails
Click image for larger version
Name:	error.JPG
Views:	166
Size:	248.7 KB
ID:	1071  
  #6  
Old 07-16-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Flavio,

if you look into the variables tree of you BasicTE5 who is metnioned inthe error window, you will see, that he has the same task sequence several times. For the first, the item can be unloaded corecctly, but for the following, you will get an error like this just since there is not an item anymore to be unloaded.
This is caused by the task sequence created multiple times...I hav´nt yet figured out, why.

Rlaf
Flexsim Germany
The Following User Says Thank You to RalfGruber For This Useful Post:
Flavio Brito (07-19-2010)
  #7  
Old 07-20-2010
Flavio Brito Flavio Brito is offline
FlexSim Distributor
 
Join Date: Jan 2010
Posts: 42
Downloads: 109
Uploads: 0
Thanks: 47
Thanked 8 Times in 7 Posts
Rep Power: 132
Flavio Brito is on a distinguished road
Default

Ralf,

First of all, thanks for everything, your hints have been very usefully for me.

The several task sequences was created as the allowed number of TEs on areas was increased than 1, I don't know why, and this problem still continues.

I set the allowed numbers in area to 1, this way was created only one task sequence in TE (at least to item arrives once in the end of the model), but when the Te arrives at waitingpoint2, his stop there, get a new task sequence but not dispatch the first, staying stopped. Why??

Another question: to point 1 to 4 request another traveler from waiting point1 the only and best way is by messages??

Best regards,

Flavio
Attached Files
File Type: zip Choosing the lower queue.zip (77.0 KB, 154 views)
  #8  
Old 07-20-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Hi Flavio,

the stop f the taskexecuter at waiting point 2 is a result of you creating an empty tasksequenceon the traveller directly, but not dispatching it (code line 21 in OnArrival of waiting point 2).
On more remark: You could solve the task only to allow two travellers ion the pathes between waiting point one and the loading queues easily by setting their capacities to only two. Now you can go ahead and use Flexsim´s standard "Request Transport from" checkbox and don´t need to care about regulating traffic by traffic controls. Just delete those.
So you won´t need to explicitly request taskexecuters from waiting point one...
Another way instead of sending a message would be to open and close outputs of objects to just usse the standard mechanism to create tasksequences.

If I find some time today, I will build an "easy as can be" model for you...

Ralf
Flexsim Germany
The Following User Says Thank You to RalfGruber For This Useful Post:
Flavio Brito (07-20-2010)
  #9  
Old 07-20-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Flavio,

attached you find my model using a little trick:
Instead of sending the FlowItems directly from Sector 1 to Sector 2, I sent them to TempQueue in between and from there to the final destination in Sector 2. So setting the capacities of Queue5 and 6 to two also automizes that procedure of finding the right destination.

There are three things to be taken care of:
1. Load and Unloadtime at TempQueue need to be zero not to mess up results. This is done on "Loadtime" and "Unloadtime" of each BasicTE.

2. It has to be made sure, that a BasicTE doesn´t get a new transport order from the dispatcher after unloading at TempQueue. This is managed by just closing his input after loading a FlowItem. The code is in "OnLoad Trigger" of each BasicTE. "OnUnload Trigger" the BasicTE is released again, when the unload station is not TempQueue.

3. The same BasicTE who brought the FlowItem to TempQueue should load it again. This is done by saving a reference to the BasicTE on the FlowItem´s label "TravelerID" "OnLoad Trigger" of the BasicTE. The TempQueue doesn´t use the dispatcher connected to centerport one to find a BasicTE for transport, but it explicitly creates the tasksequence in the same BasicTE, which brought the FlowItem. See "Request Transport from" on TempQueue. That tasksequence also sends the BasicTE back to waiting point one after unloading.

Hope you understand everything I did.

Ralf
Flexim Germany

BTW: I have seen your table with load and unload times. If you wanted to use that, you will just need to change the LoadTime and UnloadTime code of the BasicTE´s.
Attached Files
File Type: zip Choosing the lower queue_RG.zip (63.7 KB, 157 views)
The Following 3 Users Say Thank You to RalfGruber For This Useful Post:
Tom David (07-21-2010)


Thread Thread Starter Forum Replies Last Post
a question on queue KelvinHo Q&A 15 11-09-2011 07:16 AM
Pulling from a Queue vs Sorting the Queue Brandon Peterson Tips and Tricks 3 03-03-2010 01:27 AM
How to pull items from a queue? Daglys Brizo Q&A 3 09-04-2009 08:17 AM
Queue Sorting Jeff Nordgren Q&A 12 05-22-2008 03:21 PM
Queue stacking Paul Dowling Q&A 2 11-27-2007 11:57 PM


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.