How do I generate random numbers and print that information in the output console that I write? I'm just using a source and sink I would appreciate a help
A random whole number a random decimal number, what? If you are wanting a random whole number between 1 and 100, you would write something like this:
print(duniform(1, 100)); //Prints the number to the output console
Is this what you are looking for?
print( value or string, value or string, value or string,..)
is a new command to write in the output console
Generate numbers from 0 to 1, I do not print the numbers in the output console: the code you used was in the triggers on exit tab double ran = randnext (1); pf (ran); pt (""); What error is there ?? @Jeff Nordgren
uniform(0,1) will give a real number between 0 and 1.
Not exactly sure what you are after. The answers that @Ben Wilson and @Jörg Vogel gave seem to answer your question. If they don't answer your question, can you explain why they don't?
Thanks.
@Gary Q2, duniform( number left side, right side of the interval, number of the. random number stream) if you are looking for discrete values.
uniform( left side or minimum value, right side or maximum value, random number stream) for a continuous floating number interval as double.
double numberRandom = uniform(0,1,0); // random interval ]0..1[ print(numberRandom); // print random number
9 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved