Simulation Input Control

After a simulation model has been constructed, it is typically exercised under a number of different conditions to characterize the system it represents. While the model itself remains the same, aspects of its environment, or parameters that it offers are varied to establish patterns of behavior or relationships between certain inputs of the system and selected outputs. The inputs and outputs vary with each system that is modeled and depend on the goals of the simulation study. This section describes how a model’s inputs can be controlled when running simulations.

Stochastic Modeling

Many simulations rely on stochastic modeling of certain elements to represent behavior that is not known in a precise fashion but that can be characterized by associating probabilities with a set of outcomes. Some common applications requiring this technique are as follows:

  • Traffic loads of communication networks usually result from the aggregation of many individual sources. These individual sources usually correspond to users whose traffic submissions are not precisely predictable. In addition, these sources are generally not coordinated with each other, leading to a traffic flow that appears random. Other user-determined properties of network traffic, such as selection of destinations and service-quality parameters, are also often modeled in a stochastic manner to reflect the variability of user choices.
  • Certain computer operations require variable execution times to complete. Some correspond to the use of physical devices with delays that may change, such as disks or tape drives. In other cases, contention for computer resources such as the bus, CPU, or memory may present a particular task with variable delays in accessing these resources. These delays may be modeled by explicitly representing all the tasks that contend for the resources, or the presence of other tasks may be modeled in a more abstract fashion by incorporating variable delays into operations that access the resources of interest.
  • The definition of certain communication protocols requires them to do operations on a random or pseudo-random basis. Common examples include selecting random timer values for message retransmissions, and randomly selecting an order in which to service multiple contending traffic sources.
  • The quantity and placement of bit-errors affecting transmitted packets are usually modeled as random processes. In fact, link quality is typically characterized in statistical terms by manufacturers or service providers, providing a straightforward mapping into a stochastically parameterized model.

Creating Variable Behavior

Many simulations rely on stochastic modeling of certain elements to represent behavior that is not known in a precise fashion, but which can be characterized by associating probabilities with a set of outcomes. Stochastically modeled elements depend on a random number source on which to base their behavior. By “drawing” from the source, these elements can incorporate variability into appropriate actions or decisions as they are taken.

As mentioned earlier, it is impossible for a computer program, by its very nature, to exhibit genuinely unpredictable behavior. If a simulation program remains the same for multiple simulation runs, any change in its behavior must come from a change in its operating environment (i.e., its input). In particular, even the random number stream used to implement stochastic behavior must be forced into a different mode to yield different results from one simulation to the next.

The mechanism used to select new random number sequences relies on starting the pseudo-random number generator in a different state each time (“pseudo-random” because it is impossible to generate truly random numbers on a computer). Because it determines all future output of the pseudo-random number generator, this initial state is known as the random number seed. For discrete event simulations, the random number seed can be set with the integer “seed” preference. In addition, it can be designated from within the GUI on a per-simulation basis.

For a simulation that incorporates stochastic elements, each distinct random number seed value will produce different behavior and yield new results. Each particular simulation can then be thought of as representing one possible scenario of events for the modeled system. However, no single simulation can necessarily be used as an accurate gauge of “typical” system behavior, because it is conceivable that even atypical behaviors (provided they are possible) might be achieved for some random number seed.

To account for such statistical anomalies, the simulation model must be exercised multiple times while varying the random number sequence. The results obtained from the separate simulations should then be combined (for example, by averaging) to estimate typical behavior. Varying the random number seed across a family of simulations helps ensure statistical validity. This protects your simulation results from being skewed because of a statistical outlier and allows you to associate a larger degree of confidence with your results. Riverbed Modeler inherently supports this workflow of running a family of simulations with varying random number seeds (see Simulation Sequences). It also expedites the process by allowing the distribution of a series of simulations to multiple machines for simultaneous execution (see “Distributed Simulation” on page 422).

Random Number Generation

Modeler uses a random number generator in the following circumstances:

  • Pipeline stages use random numbers to allocate bit errors to packets.
  • The KPs op_dist_uniform() and op_dist_outcome(), used by many process models, return results that are dependent on a random number sequence.

In both cases, random numbers are drawn (usually) from a single random number sequence. The random number generator used to create this sequence is a port of the random() function from the BSD UNIX source distribution. This generator has a period of 2^31-1. (A newer random number generator based on the Mersenne Twister algorithm can be selected with the “rand_gen_type” preference.)

Although typical operation uses a single, simulation-wide random number sequence, Modeler also can generate random number sequences on a per-module basis. This is particularly useful for parallel simulation. For details, see Generating Random Numbers.

For models that require complete independence of random number sequences used by different stochastic elements, processes and pipeline stages can make independent calls to the host computer’s random number facility or other, proprietary random number generators. They can also use the KPs described in the “Random Sub-Package” on page 103, which support the creation of independent random number streams. The Dist package of the Simulation Kernel provides a special KP—op_dist_outcome_ext(), described in the “Distribution Package” on page 1—that supports use of probability distributions with proprietary random number generators.

Simulation Parameterization

In addition to varying random number seeds to obtain a range of stochastic behaviors, many simulation studies also vary certain properties, or operating conditions of the model. This way, the modeled system can be characterized for a range of possible configurations to support trade-off analysis and determine the system’s limitations and peak performance conditions.

The primary mechanism used to vary model configuration is based on the use of promoted object attributes. Promoted attribute values can be altered at each simulation, without modification of the simulation models or simulation program. Promoted attributes are attributes of objects whose values have been left unassigned, precisely so that these assignments could instead be completed at the time of simulation execution. In other words, promoted attributes can be thought of as simulation program parameters provided by the model designer. For more information about attribute promotion, see “Modeling Framework” on page 80.

A second mechanism that supports variation of model configuration is based on the use of variables that are not associated with any particular objects. These variables are called simulation attributes and their values can be obtained by user-defined logic via the KP op_ima_sim_attr_get(). Because simulation attributes have no association with objects, they are well-suited to representing system-wide, or global parameters. The interpretation and application of simulation attributes and their values is left to the user-defined code; the Kernel merely provides an interface to facilitate this type of parameterization.

Both promoted attributes and simulation attributes are treated in the same manner when a simulation’s parameters are specified. Modeler allows each simulation to complete a numerical attribute’s specification by providing either a specific value, a range of values, or a set of discrete values. Non-numerical attributes can only be assigned a specific value. When at least one attribute is assigned a range or set of values, the user has implicitly specified multiple simulation runs to be executed, each with a distinct value of the attribute. When more than one attribute is assigned a range or set of values, Modeler executes a separate simulation for each unique combination of attribute values. Be careful not to launch an excessive number of simulations this way. Figure 246 shows the specification of simulation parameters. For more information about setting parameters, see “Configuring a Simulation” on page 395.

Figure 246: Attribute Value Specification

Attribute value specification

Note: When executing simulations outside the GUI, attributes can be assigned via the full range of environment attribute mechanisms provided for all Modeler programs and described in Chapter 1 “System Environment” on page 1. These mechanisms include assignment via the command line, as well as use of one or more environment files, and the preferences file.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com