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-09-2010
shafizad shafizad is offline
ProcSim Consulting
 
Join Date: Jul 2010
Location: Switzerland
Posts: 75
Downloads: 18
Uploads: 0
Thanks: 90
Thanked 2 Times in 2 Posts
Rep Power: 126
shafizad is on a distinguished road
Default Creating more than one itemflow in source (inter-arrival time style)

Problem::
I would like a source to generate 14 flowitems all at the same time( which this time is determined by an exponential distribution for the first working shift (0-7 hr). )
for example, a camion comes with 14 packages at some unknown time in the first shift.


My unsuccessful Approach::
I tried to create more than one itemflow in inter-arrival time style in source.
I used the "by time of day" pick-down option. it is only possible for one item in this case then, a solution would be to use a seperator to unpack one item to several (say 14) in above configuration.

Do u have any better suggestion
  #2  
Old 07-09-2010
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi,

I would use your suggested approach with the separator, it is a easy solution to do and you will be using Flexsim standard objects.


Lars-Olof
  #3  
Old 07-09-2010
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello shafizad,

If you only have to set the arrival time once, you could choose an arrival schedule of one row on the source, with a quantity of 14.
On the Reset Trigger of the source you could define a double ArrivalTime as an exponential distribution.
You add the Arrival Time to the table with the following code:
setnodenum( node( "/schedule/1/1", variables( current ) ), ArrivalTime );

Of course if you need to change the arrival time more than once, you could add this code to the message trigger and send a message each time you need the arrival time changed.

Esther
The Following 2 Users Say Thank You to Esther Bennett For This Useful Post:
Steven Hamoen (07-09-2010)
  #4  
Old 07-09-2010
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

In this model I send a message on the source creation trigger to itself with the idea to use the OnMessage pickoption to create a number of flowitems. I had to add releaseitem() to that pickoption though which is why I post the model here.

This allows you to retain the exponential inter-arrival time.
Attached Files
File Type: zip CreateMultAtInterval.zip (50.5 KB, 274 views)
The Following 5 Users Say Thank You to Jason Lightfoot For This Useful Post:
Tom David (07-09-2010)
  #5  
Old 07-12-2010
shafizad shafizad is offline
ProcSim Consulting
 
Join Date: Jul 2010
Location: Switzerland
Posts: 75
Downloads: 18
Uploads: 0
Thanks: 90
Thanked 2 Times in 2 Posts
Rep Power: 126
shafizad is on a distinguished road
Default

Quote:
Originally Posted by Jason Lightfoot View Post
In this model I send a message on the source creation trigger to itself with the idea to use the OnMessage pickoption to create a number of flowitems. I had to add releaseitem() to that pickoption though which is why I post the model here.

This allows you to retain the exponential inter-arrival time.
Thanks for answering me. I find a problem with your model. simply by putting parameters to what is tractable (for example, msgparam(1)=2 and inter-arrival time to by expression= 50), u find out that it doesn't behave as expected (as in this example, gives back every 50 time units, 3 flowitems of rank 1).

I had the same idea as you at the first place, but the problem is that each time you create an item, it sends a message. for each message it does create surplus flowitems and also sends messages(unfortunately). this is a loop creating unwanted additional flowitems.
  #6  
Old 07-12-2010
shafizad shafizad is offline
ProcSim Consulting
 
Join Date: Jul 2010
Location: Switzerland
Posts: 75
Downloads: 18
Uploads: 0
Thanks: 90
Thanked 2 Times in 2 Posts
Rep Power: 126
shafizad is on a distinguished road
Default

Quote:
Originally Posted by Esther Bennett View Post
Hello shafizad,

If you only have to set the arrival time once, you could choose an arrival schedule of one row on the source, with a quantity of 14.
On the Reset Trigger of the source you could define a double ArrivalTime as an exponential distribution.
You add the Arrival Time to the table with the following code:
setnodenum( node( "/schedule/1/1", variables( current ) ), ArrivalTime );

Of course if you need to change the arrival time more than once, you could add this code to the message trigger and send a message each time you need the arrival time changed.

Esther
Thanks for getting back.

Could u upload a model of your suggestion.(actually, I am new to this kind of programming and I need more than a hint).
btw, I expect my model to work 5 days of week and for each day, I want a camion (say, containing 14 packs) arriving at some exponentially distributed time in the first shift.
  #7  
Old 07-12-2010
shafizad shafizad is offline
ProcSim Consulting
 
Join Date: Jul 2010
Location: Switzerland
Posts: 75
Downloads: 18
Uploads: 0
Thanks: 90
Thanked 2 Times in 2 Posts
Rep Power: 126
shafizad is on a distinguished road
Default Solution Found.

I would like to thank the contributions.

ONLY, you have to add in the OnCreation this line of code insertcopy(...);

BEST,
Attached Files
File Type: zip CreateMultAtInterval.zip (48.2 KB, 241 views)
  #8  
Old 07-12-2010
Esther Bennett Esther Bennett is offline
Flexsim User
 
Join Date: Mar 2008
Posts: 115
Downloads: 27
Uploads: 0
Thanks: 103
Thanked 116 Times in 50 Posts
Rep Power: 271
Esther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to allEsther Bennett is a name known to all
Default

Hello Shafizad,

I did not build a model, so I will not upload it and actually I like Jason's solution a little better, but I will try to explain a modified version of his model and maybe you will understand better.
You could go at it like this:
Make sure that the source doesn't create objects 'automatically'. In Jason's model, one objects is created every 100 seconds and with the OnCreation trigger, he adds another 13 objects and that is not what you want.
You could select the arrival schedule option and define that the source should not create any objects at time 0. (set quantity to 0 ) and don't use the OnCreation trigger.
Now on the triggers tab you open the OnReset trigger. In this trigger you define a FirstArrivalTime, based on the first time you want the objects to arrive in your model. You send a delayed message to current, with a delay of FirstArrivalTime.
On the OnMessage trigger of the source, you select the pick option:
CreateFlowItem. If you want to create 14 objects everytime, you can just set the Number to create to 14 (in stead of msgparam(1). If you want to create the same flowitem, you can set the Flow item bin rank to 1 (in stead of msgparam(2). The destination would be the queue and could be referred to as outobject( current, 1 ) (in stead of current).
If you test it like this, you will see that 14 obejcts will be created at FirstArrivalTime.
Now you would like to repeat this for every first five days of every week. At the end of the OnMessage trigger, you would have to create a value NextCreationTime, that defines the duration between the current camion and the next camion. Then again send a delayed message to current with the delay NextArrivalTime.

I hope this made you understand a little bit better how you can use the different triggers to manipulate the source object to get what you want.
Good luck,

Esther
The Following 2 Users Say Thank You to Esther Bennett For This Useful Post:
Tom David (07-12-2010)
  #9  
Old 07-12-2010
shafizad shafizad is offline
ProcSim Consulting
 
Join Date: Jul 2010
Location: Switzerland
Posts: 75
Downloads: 18
Uploads: 0
Thanks: 90
Thanked 2 Times in 2 Posts
Rep Power: 126
shafizad is on a distinguished road
Default

Quote:
Originally Posted by Esther Bennett View Post
Hello Shafizad,

I did not build a model, so I will not upload it and actually I like Jason's solution a little better, but I will try to explain a modified version of his model and maybe you will understand better.
You could go at it like this:
Make sure that the source doesn't create objects 'automatically'. In Jason's model, one objects is created every 100 seconds and with the OnCreation trigger, he adds another 13 objects and that is not what you want.
You could select the arrival schedule option and define that the source should not create any objects at time 0. (set quantity to 0 ) and don't use the OnCreation trigger.
Now on the triggers tab you open the OnReset trigger. In this trigger you define a FirstArrivalTime, based on the first time you want the objects to arrive in your model. You send a delayed message to current, with a delay of FirstArrivalTime.
On the OnMessage trigger of the source, you select the pick option:
CreateFlowItem. If you want to create 14 objects everytime, you can just set the Number to create to 14 (in stead of msgparam(1). If you want to create the same flowitem, you can set the Flow item bin rank to 1 (in stead of msgparam(2). The destination would be the queue and could be referred to as outobject( current, 1 ) (in stead of current).
If you test it like this, you will see that 14 obejcts will be created at FirstArrivalTime.
Now you would like to repeat this for every first five days of every week. At the end of the OnMessage trigger, you would have to create a value NextCreationTime, that defines the duration between the current camion and the next camion. Then again send a delayed message to current with the delay NextArrivalTime.

I hope this made you understand a little bit better how you can use the different triggers to manipulate the source object to get what you want.
Good luck,

Esther
Hi and thanks Esther,
I liked the way you manipulate the messages. it works fine btw.
I had also used the Timetable for the shutdown of source object for the shifts I didn't want.

Your suggestion is better than Jason because it allows easier manipulation of exponentially distributed of arrival time. (because my next-level problem is to have 2 such camions at exponentially distributed time at the deposit.)


IF u don't have time, IGNORE THE LINES BELOW, PLS:
I believe the solution would be a good pick-up option to be added into the standard library of Flexsim and be called "Camion source style"

Last edited by shafizad; 07-12-2010 at 08:09 AM. Reason: my next-level problem

Tags
by time of day, inter arrival time, shift, source


Thread Thread Starter Forum Replies Last Post
Arrival schedule Source Nico Zahn Q&A 3 12-15-2008 04:23 AM
Time-Varrying Source Doesn't Like Small Standard Deviation david_white Q&A 10 06-26-2008 01:31 PM
the accurate time of creating a TS? qin tian Q&A 1 05-26-2008 06:23 PM
Inter Arrival Time by Time of Day Mod Brandon Peterson Tips and Tricks 0 04-23-2008 11:13 AM
How to use the actual date/time data in Arrival Schedule Mode of Source syseo Q&A 0 10-12-2007 08:22 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.