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 12-08-2008
BenjaminBuecklein's Avatar
BenjaminBuecklein BenjaminBuecklein is offline
Flexsim User
 
Join Date: Sep 2008
Location: Cottbus, Germany
Posts: 11
Downloads: 6
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 142
BenjaminBuecklein is on a distinguished road
Default Commsission of pallets

Hello everyone,

I've just made a little modell to visualize my problem.

I've got 2 queues in my modell. these queues batch and release if the batch content is reached.
Now, I'd like to become the boxes in the queue completely transportet to only one sink.
The queue should select the port of a sink, close the selected sink for the other queue and open it when becoming ready again.
This is just a little sample modell. In my real modell there are 15 sinks and 3 or 4 queues and the boxes get transported by 5 Transporters managed by a dispatcher.
Hope you understand what I'm trying to do.

Regards,

Benjamin
Attached Files
File Type: zip Sample Modell Auftrag.zip (44.1 KB, 275 views)
  #2  
Old 12-08-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Benjamin,

I think there are 2 solutions.

1 you close the input ports of the sink on reset with closeallip.
you send a message to the sink on endcollecting with the input port of the sink that has to be opened and the amount of products the sink is going to receive.
on the sink you open that port with openip and if the last one enters you do closeallip again.
The problem here is that you have to keep track of the message that are send to you because if you are serving one queue and the other also has a complete batch, you have to store that message and process it.
Also using closeallip and openip can be dangerous because the internal logic of an object could overwrite your command in which case you have to use extra senddelayed message to open or close ports.

2 the other solution is by using the tasksequence of the operator. The moment the queue has collected a batch of say 5 products it generates 5 tasksequences to transport these boxes to a sink. The operator (or the dispatcher ) have a queue strategy trigger that you could use to list the jobs from the different queue's in the right order. In this case you have to create the tasksequences yourself and give them a priority value that is the same for all the products but different then those of different queue and keeping in mind the priority.
You could for instance set the priority, when creating the tasksequence, on 9999999 - time(); that way the first queue to release items has the highest priority and all those items are released on the same moment so that value is the same for all those products.
Other option would be to add a TAG tasktype and change the queue strategy so that it looks at that TAG task

Hope this gives you some ideas

Steven
  #3  
Old 12-08-2008
BenjaminBuecklein's Avatar
BenjaminBuecklein BenjaminBuecklein is offline
Flexsim User
 
Join Date: Sep 2008
Location: Cottbus, Germany
Posts: 11
Downloads: 6
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 142
BenjaminBuecklein is on a distinguished road
Lightbulb

Hey Steve,

thanks for the very quick reply and your ideas. But now I figured something out for myself.

Here is my solution:

In the Queue's flow-tab I just modified the code for "send to random available port a little bit. I created a label called "PortNr" and the code looks like this:

treenode item = parnode(1);
treenode current = ownerobject(c);
/**Random Available Port*/
/** \nIf no ports are are available, send to the first port to become available.*/

double arraysize = nrop(current);
doublearray openports = makearray(arraysize);
int nrofportsopen = 0;

if (getlabelnum(current,"portnr")==-1)
{
for( int index = 1; index <= arraysize; index++)
{
if( objectexists(outobject( current , index)) && ipopen(outobject( current , index), opipno( current , index)) && get(connectionsin(outobject( current , index)))==0 )
{
nrofportsopen++;
openports[ nrofportsopen ]
[h1] index;
}
}

double returnvalue;
if(nrofportsopen > 0)
{
int returnindex [/h1]
duniform(1, nrofportsopen);
returnvalue = openports[returnindex];
setlabelnum(current,"portnr",returnvalue);
}
else
returnvalue = 0;

return returnvalue;
setlabelnum(current,"portnr",-1);

}
else
{
return getlabelnum(current,"portnr");
}




And in the OnReset and OnEntry trigger I used this:

/**BB: Rücksetzen PortNr*/
treenode item = parnode(1);
treenode current = ownerobject(c);
int port = parval(2);
setlabelnum(current,"portnr",-1);


Now the Queue sends the batched contents completely to one port and close the receiveport for the other queues.

But your answer might be useful in other ways.

So, thanks a lot.

Best regards
  #4  
Old 12-08-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Benjamin,


Using a label is a fast and good solution, stupid of me I didn't think of it. But you don't have to take this difficult "random when available" rule.
but something like:

if( getlabelnum( current, "portnr") == -1)
{
setlabelnum( current, "portnr", duniform( 1, nrop( current )));
}

return getlabelnum( current, "portnr");

would be sufficient. The sink will never close its ports so all ports are always available so that would be the same as simply chosing a random one from the ports that are present.

But I guess you want to send to a specific sink based on some parameters because otherwise you could simply write: "return 1;" but I guess you knew that.

BTW in your code you write:
return returnvalue;
setlabelnum(current,"portnr",-1);

This means that in this piece of code the "setlabelnum" is never executed because the function is left at the return.

Regards,

Steven
  #5  
Old 12-08-2008
BenjaminBuecklein's Avatar
BenjaminBuecklein BenjaminBuecklein is offline
Flexsim User
 
Join Date: Sep 2008
Location: Cottbus, Germany
Posts: 11
Downloads: 6
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 142
BenjaminBuecklein is on a distinguished road
Default

Thanks for this hint.
It is possible that this little piece of code is responsible for some disgusting problems in my modell.

Hmm...

I think I'll try to put it where it's getting executed, and we will see.

So, now, I've had enought today and resume tomorrow.

Until then...


Thread Thread Starter Forum Replies Last Post
Combiner Target Quantity, Release of packed pallets BenjaminBuecklein Q&A 1 09-04-2008 03:31 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.