How do I generate a random number from a distribution in my process model ?

Categories:
Solution Number:
S20590
Last Modified:
2013-08-20
Issue

How do I generate a random number from a distribution in my process model ?

Solution

The Kernel Procedure (KP) op_dist_load () may be used to load a distribution of choice (e.g: exponential, constant). This KP returns a pointer to the specified distribution.In order to generate a random number with this distribution, use the KP op_dist_outcome (). This KP takes as input the pointer that you obtained from op_dist_load () and generates a number. Both KP's are documented in the OPNET Simulation Kernel Manual (Anim-Pk). Example code would look like:dist_ptr = op_dist_load (exponential, 5, 0);random_number = op_dist_outcome (dist_ptr);Please refer to the documentation to obtain the list of supported distributionsand their arguments.

Environment

DES Kernel->Process Modeling/Coding,DES Kernel->Statistics and Reports

Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case