Skip to Main Content Skip to Search
Product Documentation

Customizing the Debugger Simulation Log

Customizable Information in the Simulation Log

You can configure the SimEvents debugger to include or omit certain kinds of messages in its simulation log. You can focus on the messages that are relevant to you by omitting irrelevant messages.

The overall configuration regarding including or omitting messages is called the debugger's detail settings. Each individual category of messages that you can include or omit corresponds to an individual detail setting. A particular detail setting is on if the simulation log includes messages in the corresponding category.The setting is off if the simulation log omits messages in the category.

The detail function lets you configure and view detail settings. The following table lists the available detail settings and the programmatic names that you see as inputs or field names when you use the detail function.

Category of MessagesProgrammatic Name in detail FunctionFurther Information About Messages in Category
Event operations, except independent operations representing event executionsevEvent Scheduling, Execution, and Cancelation Messages
Entity operationsenEntity Operation Messages
Event calendar informationcalOptional Displays of Event Calendar in the Simulation Log
Signal operationssigSignal Operation Messages

Messages that you cannot selectively omit from the simulation log include messages about independent operations, such as the execution of events on the event calendar. Messages about independent operations appear whenever any of the detail settings is on. The reason for including messages about independent operations is that they provide a context in which you can understand other messages. To learn more about independent operations, see Independent Operations and Consequences in the Debugger.

Tips for Choosing Appropriate Detail Settings

Different debugging scenarios benefit from different detail settings. Use these suggestions to help you choose appropriate settings for your needs:

Effect of Detail Settings on Stepping

The behavior of detail and step are related. If you change the detail settings from their default values to cause the simulation log to omit entity messages or event messages, then you cannot step to an operation that corresponds to an omitted message, unless a breakpoint coincides with the operation. A specific example of this behavior follows.

If your detail settings cause the simulation log to omit all messages (equivalent to the detail none command), you cannot step to anything other than breakpoints. In the absence of breakpoints, a step causes the simulation to proceed until the end. If you inadvertently reach the end of the simulation in this way and want to return to the point in the simulation from which you tried to step, use a time or event identifier that appears in the Command Window to set a breakpoint in a subsequent debugging session. For example, if the last message in the simulation log, before you inadvertently stepped too far, indicates the execution of event ev5, then you can exit the debugger session, restart it, and enter evbreak ev5; cont.

Example: Skipping Entity Operations When Stepping

When the detail setting for entity operations is off, the simulation log omits messages about entity operations and you cannot step to entity operations.

  1. Open and debug a model. At the MATLAB command prompt, enter:

    simeventsdocex('doc_sldemo_f14_des')
    sedebug('doc_sldemo_f14_des')
  2. Omit entity operation messages. At the sedebug>> prompt, enter:

    detail('en',0)
  3. Proceed with the simulation. At the sedebug>> prompt, enter the following command six times in succession:

    step

    The output reflects that when you step through the simulation, the debugger does not suspend the simulation upon the entity's generation, advancement, attribute assignment, or destruction. The reason is that the detail setting for entity operations is off.

    Detected Sample Time Hit                              Time = 0.000000000000000
    : Block = Subsystem/Event-Based Entity Generator
    sedebug>> step
        %..........................................................................%
        Scheduling EntityGeneration Event (ev1)
        : EventTime = 0.000000000000000 (Now)
        : Priority  = SYS1
        : Entity    = <none>
        : Block     = Subsystem/Event-Based Entity Generator
    %==============================================================================%
    Executing EntityGeneration Event (ev1)                Time = 0.000000000000000
    : Entity = <none>                                     Priority = SYS1
    : Block  = Subsystem/Event-Based Entity Generator
    sedebug>> step
        %..........................................................................%
        Scheduling ServiceCompletion Event (ev2)
        : EventTime = 0.055383948677907
        : Priority  = 500
        : Entity    = en1
        : Block     = Subsystem/Infinite Server
    %==============================================================================%
    Executing ServiceCompletion Event (ev2)               Time = 0.055383948677907
    : Entity = en1                                        Priority = 500
    : Block  = Subsystem/Infinite Server
    %==============================================================================%
    Detected Sample Time Hit                              Time = 0.100000000000000
    : Block = Subsystem/Event-Based Entity Generator

    To see which entity operations the debugger omits, compare your output with the items in the table in Confirming Event-Based Behavior Using the SimEvents Debugger. Items 4, 5, 6, 7, 10, 11, and 12 in the table do not appear in this example because these items represent entity operations.

  4. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit

How to View Current Detail Settings

To view the current detail settings in the Command Window, at the sedebug>> prompt, enter:

detail

The output looks like this, where the on and off values depend on your current detail settings:

Event Operations  (ev)   :  on
Entity Operations (en)   :  off
Signal Operations (sig)  :  on
Event Calendar    (cal)  :  off

If a line in the output says on, the simulation log shows the corresponding type of message. Otherwise, the simulation log omits the corresponding type of message.

How to Change Detail Settings

To change detail settings, enter a detail command that includes one or more inputs. For available syntaxes, see the reference page for the sedb.detail function.

Tips to help you select a suitable syntax are:

Example: Including Event Calendar Information Using a Parameter/Value Pair

To cause the simulation log to include event calendar information but not change any other detail settings, at the sedebug>> prompt, enter:

detail('cal',1)

The output includes the following line confirming the change:

Event Calendar    (cal)  :  on

Example: Including Event Calendar Information Using a Structure

Entering these commands at the sedebug>> prompt has the same effect as the example above and also creates a structure variable, s, that records the new detail settings:

s = detail; % Get current detail settings.
s.cal = 1; % Change value of cal field of structure s.
detail(s); % Use s to change cal detail setting.

How to Save and Restore Detail Settings

If you expect to change detail settings frequently or temporarily during a debugger session, you can use an output from the detail function to facilitate restoring previous settings. Use this procedure:

  1. When changing detail settings, enter a detail command that includes an output. The output variable records the settings before they change to correspond to the inputs that you specify in your command.

  2. When you want to restore the earlier detail settings, use the variable as an input to detail.

As a special case, you can restore default detail settings. At the sedebug>> prompt, enter detail default.

Example: Omitting and Reinstating Entity Messages

To cause the simulation log to include event calendar information and also create a structure variable, prev, that records the previous detail settings, at the sedebug>> prompt, enter:

prev = detail('cal',1) % Record settings and then change them.

The next command restores the earlier settings:

detail(prev) % Restore previous settings.
  


Free SimEvents Evaluation Kit

Learn how you can use SimEvents discrete-event simulation capabilities through these technical resources.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS