Quantcast

Documentation Center

  • Trial Software
  • Product Updates

sedb.evbreak

Package: sedb

Set breakpoint for execution or cancelation of event

Syntax

evbreak(evid)
bid = evbreak(evid)

Description

evbreak(evid) sets a breakpoint for execution or cancelation of the event with identifier, evid, in the simulation. To obtain a list of events on the event calendar and their identifiers, use sedb.evcal.

bid = evbreak(evid) returns the identifier of the breakpoint.

Input Arguments

evid

String that represents an event identifier.

Output Arguments

bid

String that represents a breakpoint identifier.

Examples

Set a breakpoint on a service completion event:

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

    sedebug('sedemo_server_service_time')
  2. Proceed in the simulation. At the prompt, enter:

    step over

    The output is:

    %==============================================================================%
    Initializing Time-Based Entity Generators
        %..........................................................................%
        Scheduling EntityGeneration Event (ev1)
        : EventTime = 0.000000000000000 (Now)
        : Priority  = 500
        : Entity    = <none>
        : Block     = Time-Based Entity Generator 3
    %==============================================================================%
    Executing EntityGeneration Event (ev1)                Time = 0.000000000000000
    : Entity = <none>                                     Priority = 500
    : Block  = Time-Based Entity Generator 3
  3. Proceed further:

    step over

    The output shows that a service completion event with identifier, ev2, appears on the event calendar. The scheduled time of the event is =1.5.

        %..........................................................................%
        Generating Entity (en1)
        : Block = Time-Based Entity Generator 3
        %..........................................................................%
        Entity Advancing (en1)
        : From = Time-Based Entity Generator 3
        : To   = Set Attribute
        %..........................................................................%
        Setting Attribute on Entity (en1)
        : myServiceTime = 1.5
        : Block = Set Attribute
        %..........................................................................%
        Entity Advancing (en1)
        : From = Set Attribute
        : To   = N-Server
        %..........................................................................%
        Scheduling ServiceCompletion Event (ev2)
        : EventTime = 1.500000000000000
        : Priority  = 500
        : Entity    = en1
        : Block     = N-Server
        %..........................................................................%
        Executing Scope
        : Block = Num. of Entities 2
        %..........................................................................%
        Scheduling EntityGeneration Event (ev3)
        : EventTime = 1.000000000000000
        : Priority  = 500
        : Entity    = <none>
        : Block     = Time-Based Entity Generator 3
    %==============================================================================%
    Initializing Time-Based Entity Generators
        %..........................................................................%
        Scheduling EntityGeneration Event (ev4)
        : EventTime = 0.000000000000000 (Now)
        : Priority  = 500
        : Entity    = <none>
        : Block     = Time-Based Entity Generator 1
    %==============================================================================%
    Executing EntityGeneration Event (ev4)                Time = 0.000000000000000
    : Entity = <none>                                     Priority = 500
    : Block  = Time-Based Entity Generator 1   
  4. Set a breakpoint that causes the debugger to stop when it is about to execute the service completion event, ev2:

    evbreak ev2

    The output confirms the operation:

    Set b1 : Breakpoint for execution or cancelation of event ev2
  5. Run the simulation until the breakpoint:

    cont

    The partial output shows that the debugger proceeds through a different event at =1, and stops upon hitting the breakpoint at event ev2. Because that event is not the first event the simulation executes at that time, the example shows how an event breakpoint differs from a timed breakpoint. A timed breakpoint at =1 would have caused the debugger to stop upon the first event at this time.

    %==============================================================================%
    Executing EntityGeneration Event (ev9)                Time = 1.000000000000000
    : Entity = <none>                                     Priority = 500
    : Block  = Time-Based Entity Generator
        %..........................................................................%
        Generating Entity (en6)
        : Block = Time-Based Entity Generator
        %..........................................................................%
        Entity Advancing (en6)
        : From = Time-Based Entity Generator
        : To   = Single Server
        %..........................................................................%
        Scheduling ServiceCompletion Event (ev15)
        : EventTime = 2.000000000000000
        : Priority  = 500
        : Entity    = en6
        : Block     = Single Server
        %..........................................................................%
        Scheduling EntityGeneration Event (ev16)
        : EventTime = 3.000000000000000
        : Priority  = 500
        : Entity    = <none>
        : Block     = Time-Based Entity Generator
    
    Hit b1 : Breakpoint for execution or cancelation of event ev2
    
    %==============================================================================%
    Executing ServiceCompletion Event (ev2)               Time = 1.500000000000000
    : Entity = en1                                        Priority = 500
    : Block  = N-Server
    
  6. End the debugger session. At the prompt, enter:

    sedb.quit

See Also

| | |

Was this topic helpful?