How do I generate a random number from a distribution in my process model ?
How do I generate a random number from a distribution in my process model ?
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.
DES Kernel->Process Modeling/Coding,DES Kernel->Statistics and Reports