| Contents | Index |
Set breakpoint for execution or cancelation of event
evbreak(evid)
bid = evbreak(evid)
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.
evid |
String that represents an event identifier. |
bid |
String that represents a breakpoint identifier. |
Set a breakpoint on a service completion event:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_server_service_time')Proceed in the simulation. At the prompt, enter:
step overThe 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 3Proceed further:
step overThe 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 Set a breakpoint that causes the debugger to stop when it is about to execute the service completion event, ev2:
evbreak ev2The output confirms the operation:
Set b1 : Breakpoint for execution or cancelation of event ev2
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
End the debugger session. At the prompt, enter:
sedb.quit
sedb.bdelete | sedb.breakpoints | sedb.cont | sedb.evcal

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |