sedb.detail

Package: sedb

Customize debugger simulation log in discrete-event simulation

Syntax

detail(settingtype)
detail(struc)
detail(Name,Value)
prev = detail(settingtype)
prev = detail(struc)
prev = detail(Name,Value)
detail
curr = detail

Description

detail(settingtype) configures the debugger to omit or show certain simulation log messages. Choices of settingtype are described in the table.

Value of settingtypeDescription
'none' or 'off'Configures the debugger to omit all simulation log messages, except upon reaching breakpoints. This syntax is the same as detail('en',0,'ev',0,'cal',0). When the debugger omits all simulation log messages, you cannot use the step function to step to anything other than breakpoints.
'default' or 'on'Resets the detail settings to the default values of the debugger. This syntax is the same as detail('en',1,'ev',1,'sig',1,'cal',0).
'all'Configures the debugger to show all simulation log messages. This syntax is the same as detail('en', 1, 'ev', 1, 'sig', 1, 'cal', 1).

detail(struc) uses the structure struc to establish detail settings.

detail(Name,Value) configures the debugger to show or omit certain kinds of messages in the simulation log. You can specify one, two, or three Name,Value pair arguments.

prev = detail(settingtype), prev = detail(struc), or prev = detail(Name,Value) configures the debugger based on the inputs, and also returns a structure that describes the previous detail settings.

detail displays the current detail settings.

curr = detail returns a structure that describes the current detail settings.

Input Arguments

settingtype

String that specifies a group of detail settings. Choices are 'none', 'default', and 'all'.

struc

Structure having three fields describing the detail settings that you want. Field names and field values are the same as in Name-Value Pair Arguments.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'cal'

A value of 1 causes the debugger to show event calendar information messages. A value of 0 causes the debugger to omit event calendar information messages, except upon reaching a breakpoint.

'en'

A value of 1 causes the debugger to show entity operation messages. A value of 0 causes the debugger to omit entity operation messages, except upon reaching a breakpoint. When the value is 0, you cannot rely on the step function to step to an operation that corresponds to an omitted message.

'ev'

A value of 1 causes the debugger to show event operation messages. A value of 0 causes the debugger to omit event operation messages, except in these situations:

  • The debugger reaches a breakpoint.

  • The debugger is about to execute an event on the event calendar, and at least one detail setting is 1.

When the value is 0, you cannot rely on the step function to step to an operation that corresponds to an omitted message.

'sig'

A value of 1 causes the debugger to show signal operation messages. A value of 0 causes the debugger to omit signal operation messages, except upon reaching a breakpoint.

Output Arguments

curr

Structure that describes the current detail settings. Field names and field values are the same as in Name-Value Pair Arguments.

prev

Structure that describes the previous detail settings before changing them. Field names and field values are the same as in Name-Value Pair Arguments.

Examples

Configure displays for breakpoints and stepping:

  1. Begin a debugger session for a particular model. At the MATLAB® command prompt, enter:

    sedebug('sedemo_timeout')
  2. Establish a breakpoint. Then proceed in the simulation, suppressing the simulation log until the debugger reaches the breakpoint. At the sedebug>> prompt, enter:

    tbreak 2
    prev = detail('none')
    cont

    The output ends with the context of the simulation at T=2:

    Set b1 : Breakpoint for first operation at or after time 2
    
    prev =
    
         ev: 1
         en: 1
        sig: 1
        cal: 0
    
    
    Hit b1 : Breakpoint for first operation at or after time 2
    
    %==============================================================================%
    Executing EntityGeneration Event (ev10)               Time = 2.000000000000000
    : Entity = <none>                                     Priority = 1
    : Block  = Time-Based Entity Generator
  3. Now that the simulation is at a point of interest, configure the debugger to show the simulation log. This configuration makes subsequent step operations more informative. Then move forward in the simulation:

    detail(prev)
    step over

    The output confirms the change in detail settings and then shows the result of enabling the simulation log:

      Event Operations  (ev)   :  on
      Entity Operations (en)   :  on
      Signal Operations (sig)  :  on
      Event Calendar    (cal)  :  off
    
        %..........................................................................%
        Generating Entity (en4)
        : Block = Time-Based Entity Generator
        %..........................................................................%
        Entity Advancing (en4)
        : From = Time-Based Entity Generator
        : To   = Schedule Timeout
        %..........................................................................%
        Scheduling Timeout Event (ev11)
        : EventTime = 3.000000000000000
        : Priority  = 1700
        : Entity    = en4
        : Block     = Schedule Timeout
        %..........................................................................%
        Entity Advancing (en4)
        : From = Schedule Timeout
        : To   = Infinite Server
        %..........................................................................%
        Scheduling ServiceCompletion Event (ev12)
        : EventTime = 2.581301297500028
        : Priority  = 1
        : Entity    = en4
        : Block     = Infinite Server
        %..........................................................................%
        Executing Scope
        : Block = Number of Entities Time-Stamped
        %..........................................................................%
        Scheduling EntityGeneration Event (ev13)
        : EventTime = 2.500000000000000
        : Priority  = 1
        : Entity    = <none>
        : Block     = Time-Based Entity Generator
    %==============================================================================%
    Executing Timeout Event (ev5)                         Time = 2.000000000000000
    : Entity = en2                                        Priority = 1700
    : Block  = Infinite Server
  4. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit
Was this topic helpful?