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
|
|||
|
|||
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! |
#2
|
||||
|
||||
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." |
The Following User Says Thank You to Tom David For This Useful Post: | ||
nie wuwei (08-08-2009) |
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 |