| Contents | Index |
Entity information in discrete-event simulation
eninfo(enid)
en_struct = eninfo(enid)
eninfo(enid) displays information about the location, attributes, timers, and timeouts on an entity. enid is the identifier of the entity.
en_struct = eninfo(enid) returns a structure that stores information about the entity.
enid |
String that represents an entity identifier. |
View the values of the attributes of an entity:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_star_routing')Establish a breakpoint and proceed in the simulation. At the prompt, enter:
tbreak 0.1
contThe partial output shows the entity identifier, en1, in the display:
Hit b1 : Breakpoint for first operation at or after time 0.1 %==============================================================================% Executing ServiceCompletion Event (ev2) Time = 0.300000000000000 : Entity = en1 Priority = 5 : Block = Distribution Center/Infinite Server
Get the ID of an entity:
% Get ID of current entity.
enid = gcenThe workspace variable, enid, holds the same entity identifier, en1, from the display:
enid = en1
Use the identifier, enid, to display information about the entity in the Command Window:
% Display information in Command Window.
eninfo(enid)The output is:
Entity (en1) Current State T = 0.300000000000000 Location: Distribution Center/Infinite Server Attributes: Name Value CurrentRoute 1 CurrentServiceTime 2 CurrentStep 2 JobClass 1 JobID 1 JobServiceStatus [1x15] LastServiceLocation 0 ServiceProcess [1x6] ServiceTime [1x6] Timeouts, Timers: None
Store the information in variables:
% Store information in structure. endetails = eninfo(enid) % View attributes. enattrs = endetails.Attributes % View one attribute. enServiceProcess = enattrs.ServiceProcess % Equivalently, view one attribute starting from endetails. enServiceProcess = endetails.Attributes.ServiceProcess;
The output is:
endetails =
Time: 0.3000
Location: 'sedemo_star_routing/Distribution Center/Infinite Server'
Attributes: [1x1 struct]
Timers: [0x0 struct]
Timeouts: [0x0 struct]
enattrs =
CurrentRoute: 1
CurrentServiceTime: 2
CurrentStep: 2
JobClass: 1
JobID: 1
JobServiceStatus: [1x15 double]
LastServiceLocation: 0
ServiceProcess: [1 2 4 2 3 5]
ServiceTime: [2 1 5 3 4 0]
enServiceProcess =
1 2 4 2 3 5
End the debugger session. At the prompt, enter:
sedb.quit
sedb.blkinfo | sedb.currentop | sedb.evinfo | sedb.gcen

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 |