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 11-21-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default 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  
Old 11-21-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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.
  #3  
Old 11-22-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

But I have lot of flow items and that to i want to release it periodically
  #4  
Old 11-22-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

Than the second way would be yours. You´ve got different distributions for different Itemtypes?
__________________
Hemmi
  #5  
Old 11-22-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

Yes I have items with different distributions.what is the code on the creation trigger I need to type for different items?
  #6  
Old 11-22-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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
  #7  
Old 11-22-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

I searched it,I couldn't find it anywhere.I will try searching other threads of similar topic
  #8  
Old 11-22-2013
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default 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
You set the itemtype in the Trigger OnCreation.
Maybe that is a hint to your question.


Jörg
  #9  
Old 11-22-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

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
Attached Files
File Type: zip model.zip (28.5 KB, 40 views)
  #10  
Old 11-23-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

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  
Old 11-23-2013
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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");
Now you can create in OnMessage a copy of the item.
The delay time can be the value of a distributional in the delayed message, too.

Jörg
  #12  
Old 11-23-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

Jorg,still facing the problem.There is an error i dont know how to correct it.Please see the attached model
Attached Files
File Type: zip model_2.zip (86.3 KB, 40 views)
  #13  
Old 11-25-2013
arunkrmahadeva's Avatar
arunkrmahadeva arunkrmahadeva is offline
CCS, India
 
Join Date: Sep 2013
Location: India
Posts: 71
Downloads: 67
Uploads: 0
Thanks: 285
Thanked 101 Times in 51 Posts
Rep Power: 145
arunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rougharunkrmahadeva is a jewel in the rough
Default

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  
Old 11-25-2013
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hello Sagar,

what do you want to achieve with this line of code:
Code:
if(objectexists(getitemtype(item,1)))
You can querry for
Code:
if(objectexists(item))
or
Code:
if(getitemtype(item)==1)
But I do not understand which function the parameter 1 after item should have.
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  
Old 11-26-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

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  
Old 11-26-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

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.
Attached Files
File Type: zip model_3.zip (85.0 KB, 39 views)

Last edited by sagar bolisetti; 11-26-2013 at 01:23 AM.
  #17  
Old 11-26-2013
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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  
Old 11-26-2013
sagar bolisetti's Avatar
sagar bolisetti sagar bolisetti is offline
Flexsim User
 
Join Date: Aug 2013
Location: Hyderabad,India
Posts: 160
Downloads: 145
Uploads: 0
Thanks: 124
Thanked 99 Times in 63 Posts
Rep Power: 150
sagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the roughsagar bolisetti is a jewel in the rough
Default

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
Attached Files
File Type: zip model_4.zip (55.9 KB, 40 views)
  #19  
Old 11-27-2013
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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.
Attached Files
File Type: fsm BatchDistribution.fsm (13.1 KB, 47 views)
__________________
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  
Old 11-27-2013
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Quote:
Originally Posted by Sebastian Hemmann View Post
Hi sagar,
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
or 3. On Arrival send a delayed message containing the item as a number in a message parameter. The delay is a value from a statistical distribution.
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


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.