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
|
||||
|
||||
Release of flowitems from source at once
Hi forum
I have a question,i want a source to produce 3 different flowitems each have a quantity say 15,16,17 .These three flowitems have different inter-arrival time of exponential distribution.how can i despatch flow items to the downstream queues at a time with respect to their interarrival rate? |
#2
|
||||
|
||||
I think I would use 3 different Sources, one for each Flowitemtype.
Another way could be to convert your exponential distributions to one to create the arrivals just in one Source. Than you have to decide for every Item on it´s creation what type it has to become.
__________________
Hemmi Last edited by Sebastian Hemmann; 11-22-2013 at 12:37 AM. |
#6
|
||||
|
||||
In V6 it should be possible to use the pickoption Set Type. If you choose it and have a look into Skript window of this Trigger, you can find out what are used commands.
__________________
Hemmi |
#8
|
||||
|
||||
Build Batch OnExit
Hello sagar,
you can duplicate one item OnExit until you get the batchsize you wish. The first Item of your batch defines when the batch is created. Code:
int batch = gettablenum("batchsize",getitemtype(item),1); // get batchsize from a globaltable, row is the itemtype(item), batchvalue is column 1 for (batch; batch > 1;batch--) // loop for batchsize createcopy(item,outobject(current,port),1,0,1,0); // duplicate item Maybe that is a hint to your question. Jörg |
#9
|
||||
|
||||
Hii jorg i did the model like you said.But the items are created in zero time.I want to generate items based on arrival schedule.How can i achieve that
|
#10
|
||||
|
||||
I just made a try, the reset trigger should send a delayed message in a delay time of interarrival time of each itemtype ,and then perform the logic in the message trigger.
Here is the code,if some one could correct me double d_Delay = 0; if(objectexists(getitemtype(item,1))) { d_Delay = getitemtype(item,1); } if(objectexists(getitemtype(item,2))) { d_Delay = getitemtype(item,2); } if(objectexists(getitemtype(item,3))) { d_Delay = getitemtype(item,3); } senddelayedmessage(current,d_Delay,current,msgpara m1,msgparam2,msgparam3); |
#11
|
||||
|
||||
The Methode to use a delayed message could suit you, too. If an Object receive a message you can createcopy a flowitem of an item sample. The Sample could be a lonely item in a queue you create in the beginning of your simulation run. Now you need a reference to this item. Please look in the manual to build you own logic, for the command node(...) or centerobject(...), if you use a center connection. The lonely item is the first of the referred to object.
Code:
treenode item=first("referred to object"); The delay time can be the value of a distributional in the delayed message, too. Jörg |
#13
|
||||
|
||||
Hi Sagar,
I think you have to use the arrival schedule option on the source.In that option you can specify the quantities and the arrival time.You can use the repeat schedule for repeating the schedule. For specifying the arrival time using exponential distribution you can use a label approach. |
#14
|
||||
|
||||
Hello Sagar,
what do you want to achieve with this line of code: Code:
if(objectexists(getitemtype(item,1))) Code:
if(objectexists(item)) Code:
if(getitemtype(item)==1) If you do not know a programing language, use a manual: to understand the syntax, to use functions, to test the behaviour in small models, to learn and then have small successes. Jörg |
#15
|
||||
|
||||
Hi arun,I also thought to use Repeat schedule check button but that repeats only for that particular time not for regular intervals of inter arrival time.In your case i have to define explicitly time and quantities on every field till the items get finished
On using distributions on label i think i can use value by cases or global table lookup The problem right now i am facing is items are released at once not through regular intervals but in zero time.Please have a look into the model. |
#16
|
||||
|
||||
Jorg,I will follow your advice to go through manual.I am in the learning phase and i will try to improve myself.I am sorry for the mistake now i got the difference using
if(getitemtype(item)==1) if(objectexists(getitemtype(item,1))) I did not give the reference for the sample item in the message trigger.Now i did that.The parameter 1 is for function getitemtype. But still problem persists items are released in zero time not through regular intervals. Last edited by sagar bolisetti; 11-26-2013 at 01:23 AM. |
#17
|
||||
|
||||
Sagar, the function getitemtype(...) uses ONLY one parameter and this is the object of the class item or pointer to it! What do you want to achieve with this obsolete parameter "1" in the function getitemtype(...)?
But before we discuss a advanced source code, you should follow Sebastian's first advice of his first answer in this thread. Please build a model of three independent sources and control these sources individually. At your current model you faces the problem of events. You need an event at the beginning with an already created item. You have not such event. Therefore the itemtype is null. And the delaytime is zero. Jörg |
#18
|
||||
|
||||
Jorg,as per sebastian's advice i build two models.I understood the problem of releasing items at zero time.I just tried using function in userevents so that i come with a solution to the problem but in vain.
seteventtime(str EventName, num time, num timemode[1/2], num createevent[1/0]) Here are the models you asked me to build |
#19
|
||||
|
||||
Hi sagar,
I just thought you are very new to flexsim but as it seems not new to programming. Could you please share with us the distribution for the 3 itemtypes and the batchsizes you want to create? For me it looks as if you are lost in a solution that could be solved very easy but we are allready run to deep! The easy way would be: 1. Create 1 item with Distribution for whole Batch 2. Send it through Queue 3. On Arrival of Queue allways make as many copy´s of the item until batchsize is reached This way you got all items you want in the Distribution you´ve got. Is it what you are looking for? Attached an example model. The only little programming I´ve done in onArrival Trigger of Queue ;-) In Source there are only Pickoptions.
__________________
Hemmi Last edited by Sebastian Hemmann; 11-27-2013 at 02:37 AM. |
The Following 2 Users Say Thank You to Sebastian Hemmann For This Useful Post: | ||
sagar bolisetti (11-27-2013) |
#20
|
||||
|
||||
Quote:
4. On Message copy the item using the message parameter of the item number. Send a delayed message until the batchsize is reached. You can count the copied items in a label. Use this label to stop sending delayed messages to copy the item. Useful Commands are: tonum(obj); tonode(num); setlabelnum(..); getlabelnum(..) Jörg |
Thread | Thread Starter | Forum | Replies | Last Post |
How can I generate the flowitems from the source like this? | Fernando Fan | Q&A | 12 | 07-15-2011 06:40 AM |
Need FS V 5.0.0 First Release | Gleny Rodriguez | Installation | 2 | 06-04-2010 02:28 PM |
Using TE FlowItems to Transport other FlowItems | juan alberto | Q&A | 13 | 09-13-2009 09:00 AM |
Release schedule | Roland Tainton | Q&A | 3 | 03-17-2009 05:46 AM |
can "do not release item" commend be used in source? | KelvinHo | Q&A | 2 | 03-10-2008 12:30 AM |