Technical References

From Support

Jump to: navigation, search


Advanced Techniques

This page contains numerous advanced techniques that allow you to get the most out of your simulation programs. Techniques include how to start a run with simultaneously executing vertices, how to stop an event graph model on any general condition, how to use arrays of any dimension, how to run several replications of the same model in parallel, how to reduce the number of vertices in a model without changing the model's behavior, and how to use pre-emptive execution to eliminate the need to schedule some events.

General Starting and Ending Conditions

If several vertices are to be simultaneously executed or scheduled at the start of a run, create a start-run vertex (called, say, RUN) as vertex 1. Create edges from this vertex that schedule all the other vertices unconditionally with zero delay times and correct execution priorities. To stop a run on any general condition, simply create a STOP vertex as the counted event. Add appropriate edges entering this vertex, conditioned by the desired halting criterion. In SIGMA, set the ending condition in the Run Options dialog box to Stop on Event, locate the STOP vertex in the drop down list, and click on it. The Iterations box should have a count of 1.

Simultaneous Parallel Replications

To assess the variability of a simulation output series, it may be desirable to run several independent replications of the same model. Parallel replication has a number of advantages, such as making the detection of initialization bias much easier.

With event graphs, it is very easy to run these replications simultaneously. Simultaneous replication of a model is another application of event parameters and edge attributes. It might be useful here to think of parallel replicated simulations as an array of identical event graphs that are to be run at the same time.

Further information: Simultaneous Parallel Replications

Event Graph Reduction

It is sometimes possible to reduce the number of vertices in an event graph without changing the behavior of the model. Simulations with few events will often run faster than models with more events, although this is not always the case. An event graph with fewer vertices may lead to a more efficient simulation program; however, the graph may be more difficult to understand. Generally, models with a large number of very simple vertices will be easier to debug or modify than models with fewer but more complicated vertices.

Further information:Event Graph Reduction

Using Arrays of Arbitrary Dimension

Four-dimensional arrays will be sufficient to meet most simulation modeling needs. However, if you find it necessary to have higher dimensional arrays, the method discussed here is easily implemented.

Further information: Using Arrays of Arbitrary Dimension

Eliminating Event Scheduling

By using pre-emptive vertex execution (delay times = *) it is sometimes possible to run a model without scheduling events. The model, NOLIST.MOD, does this for a single server queue. The graph for this model is given in below.

In this model, the times of the next events are computed as state changes and the simulated virtual time (normally kept by SIGMA in the variable, CLK) is updated in the vertex, NEXT. The simulation generated from this model runs very fast but is difficult to modify. For readers interested in the more theoretical aspects of event graph modeling, the graph for this version of a single-server queueing system is related to the geometric dual of the event graph of our earlier model of a single server queue, CARWASH.MOD.

Event Graph Without Scheduled Events
Event Graph Without Scheduled Events

Event Execution Sequence

In SIGMA, a mathematical expression can be used almost anywhere a variable can be used. This includes vertex state changes, edge delay times, and edge attribute values. In fact, SIGMA allows the execution order of simultaneous events to be state dependent through the use of mathematical expressions to model dynamic edge priorities. This gives SIGMA additional modeling power and allows rather complex applications where state-dependent event sequencing is important. In SIGMA the order of execution for an event vertex is as follows:

  1. Set the vector of parameters for this vertex to the values of the edge attribute expressions placed on the future events list when this vertex was scheduled.
  2. Make the state changes specified for this vertex.
  3. Evaluate the edge conditions for every edge exiting this vertex.
  4. For each exiting edge with a true edge condition:
    1. If the edge is a vertex scheduling or pending edge,
      1. Evaluate each of the edge attribute expressions.
      2. Compute the edge delay time.
      3. If the delay is equal to a *, immediately execute the destination vertex and go to the next event; otherwise, compute the edge execution priority and schedule the destination vertex for this edge onto the future events list.
    2. If the edge is a vertex cancelling edge,
      1. If the edge attribute is equal to a *, cancel all scheduled vertices that are the same type as the destination vertex, regardless of the values of their attributes.
      2. If the edge attributes are left blank, cancel only the next scheduled vertex that is the same type as the destination vertex, regardless of the values of its attributes.
      3. If the edge attributes are not blank and not equal to a *, cancel any vertices that are of the same type as the destination vertex with the exact same attribute values as this cancelling edge.

Most of the time you will never have to think about execution order; however, you should be aware of it. The intuitive notion of an "event" would be a sub-graph with zero-delay times on all of the edges in this sub-graph. Event graphs are merely pictures that decompose events into manageable logical components.

File Name Extensions

The specific function of SIGMA files are identified by the extensions to their filenames as in following table:

File Name Extensions
Extension File Type Indicated
.BAK Backup copy of the last saved model
.BAT Batch files
.BMP Bitmaps used for animations
.C Source code in C
.DAT Data files for SIGMA models
.EXE Executable programs
.EXP Experiment file for batched runs (chpt. 11)
.H Source code in C
.LIB SIGMA C Function Library
.MOD Sample SIGMA models
.OUT SIGMA output files (if any)

Back to Main Page

Personal tools