sedb.simtime

Package: sedb

Current time in discrete-event simulation

Syntax

t = simtime

Description

t = simtime, at the SimEvents® debugger command prompt, returns the current simulation time.

Examples

Set a breakpoint to advance the simulation by 2 s from the current time:

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

    sedebug('sedemo_count_attributes')
  2. Use the current time to set a breakpoint. At the sedebug>> prompt, enter:

    t = simtime;
    tbreak(t+2)

    The following output confirms the setting of the breakpoint:

    Set b1 : Breakpoint for first operation at or after time 2
  3. Run the simulation until the breakpoint:

    cont

    The output describes simulation behavior and then confirms that the debugger has reached the breakpoint. Here is an excerpt:

    Hit b1 : Breakpoint for first operation at or after time 2
    
    %==============================================================================%
    Executing EntityGeneration Event (ev3)                Time = 2.000000000000000
    : Entity = <none>                                     Priority = 1
    : Block  = Time-Based Entity Generator
  4. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit
Was this topic helpful?