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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2009
nie wuwei nie wuwei is offline
Flexsim User
 
Join Date: Dec 2008
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
nie wuwei is on a distinguished road
Default How to use bernoulli function

Dear all,

I create a modle, 1 source and 2 quene, I want to source create 100 items, and 10 items send to source1,90 items sent to source2.

but sample1 always send 12 items to source1, and sample2 always send 6 items to source1. why?

Thanks!
Attached Files
File Type: zip bernoulli.zip (29.7 KB, 223 views)
File Type: zip percentage.zip (31.7 KB, 201 views)
Reply With Quote
  #2  
Old 08-08-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 515
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

What happens is called randomness.
You use a stochatic function in your model which generates a random number. Depending on this number the port is choosen.
In your two models you are nearly doing the same, but just using two different distributions.
bernoulli(10,1,2) returns with 10% value 1 and with 90% value 2.
duniform(1,100) returns values 1 to 100 uniform distributed.
Depending on the random stream you get different values. On a long simulation run the influence of the randomness will decrease so that the return values will be close to your precentages.
This is basic simulation/statistic knowledge.
If you reset and run your model a couple of times you will get different results if you do not switch Statistics/Repeat Random Stream ON in the menu. If this tick is set Flexsim will always generate the same random numbers you will get the same results.

If you do not want the randomness you could put some logic in your model like if output of the source is smaller equal 10 leave through port 1 else leave through port 2, assuming that you only generate 100 items.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
Reply With Quote
The Following User Says Thank You to Tom David For This Useful Post:
nie wuwei (08-08-2009)
  #3  
Old 08-08-2009
nie wuwei nie wuwei is offline
Flexsim User
 
Join Date: Dec 2008
Posts: 6
Downloads: 0
Uploads: 0
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0
nie wuwei is on a distinguished road
Default

Thank you for your help!

I come from China, I'm a beginner, I should learn from you.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a function to Excel Ben Wilson Tips and Tricks 4 08-10-2009 01:14 PM
simple scheduling function? Ning Wang Q&A 5 01-16-2009 11:00 AM
[Suggesiton] UNDO function KelvinHo Gripes and Goodies 10 05-23-2008 01:58 AM
Print function David Chan Gripes and Goodies 0 05-21-2008 09:38 PM
max() is a deprecated function; use maxof() instead! Lolke Koopmans Gripes and Goodies 0 02-25-2008 02:45 AM


All times are GMT -6. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.