Documentation

Inspect Entities, Blocks, and Events

Inspect Entities

These sections provide procedures and background information about inspecting entities:

For an example, see the sedb.eninfo reference page.

Inspect Location, Scalar Attributes, Timeouts, and Timers

If you expect all attributes of an entity to have scalar values or if knowing the sizes of nonscalar attribute values is sufficient, then this procedure is the simplest way to inspect the entity:

  1. Find the entity identifier using the simulation log or one of the approaches listed in Obtain Entity Identifiers.

  2. At the sedebug>> prompt, enter this command, where enid is the entity identifier:

    eninfo enid % enid is the identifier.

The resulting display includes this information:

  • Current simulation time

  • Location of the entity

  • Names of attributes of the entity

  • Scalar attribute values and sizes of nonscalar attribute values

  • Tags, scheduled times, and event identifiers of timeouts

  • Tags and elapsed times of timers

Inspect Nonscalar Attribute Values

To inspect nonscalar values of attributes of an entity:

  1. Find the entity identifier using the simulation log or one of the functions listed in Obtain Entity Identifiers.

  2. At the sedebug>> prompt, enter this command. enid is a string representing the entity identifier and en_struct is the name of a variable you want to create in the workspace:

    en_struct = eninfo(enid); % enid is the identifier.

    The output variable en_struct is a structure that stores this information:

    • Current simulation time

    • Location of the entity

    • Names and values of the attributes of the entity

    • Tags, scheduled times, and event identifiers of timeouts

    • Tags and elapsed times of timers

  3. Use dot notation to access values of any attribute as part of the Attributes field of en_struct.

    For example, to access the value of an attribute called Attribute1, use the notation en_struct.Attributes.Attribute1. The field name Attributes is fixed but the names en_struct and Attribute1 depend on names you choose for the variable and attribute.

Interpretation of Entity Location

Blocks that possess entity input ports act as storage or nonstorage blocks. Only storage blocks are capable of holding an entity for a nonzero duration. If the debugger reports a nonstorage block as the location of an entity, it means that the debugger has suspended the simulation while the entity is in the process of advancing through a nonstorage block toward a storage block or a block that destroys entities. Before the simulation clock moves ahead, the entity will either arrive at a storage block or be destroyed.

For lists of storage and nonstorage blocks, see Storage and Nonstorage Blocks.

To inspect blocks instead of entities, see Inspect Blocks.

Inspect Blocks

Procedure for Inspecting Blocks

Before inspecting a block, determine if it is capable of providing information. One way to do this is to see whether the block appears in the output of blklist. If the block is capable of providing information, use this procedure to get the information:

  1. Find a unique way to refer to the block using one of these approaches:

    • Find the block identifier using one of the approaches listed in Obtain Block Identifiers.

    • Find the path name of the block by selecting the block and using gcb, or by typing the path name. If you type the path name, be careful to reflect space characters and line breaks accurately.

  2. At the sedebug>> prompt, enter this command , where thisblk is a string representing the block identifier or path name:

    blkinfo(thisblk); % thisblk is the identifier or path name.

The resulting information depends on the kind of block you are inspecting.

Result of Inspecting Queue Blocks

When you inspect queue blocks, the display includes this information:

  • Current simulation time

  • Identifiers of entities that the block is currently storing

  • Number of entities that the block can store at a time

  • Status of each stored entity with respect to the block

  • Length of time each stored entity has been in the queue

Result of Inspecting Server Blocks

When you inspect server blocks, the display includes this information:

  • Current simulation time

  • Identifiers of entities that the block is currently storing

  • Number of entities that the block can store at a time

  • Status of each stored entity with respect to the block

  • Identifier and scheduled time of the service completion event for each entity

Result of Inspecting Other Storage Blocks

When you inspect storage blocks other than queues and servers, the display includes this information:

  • Current simulation time

  • Identifiers of entities that the block is currently storing

For the Output Switch block with the Store entity before switching option selected, the resulting display also indicates which entity output port is the selected port.

For a list of storage blocks, see Storage and Nonstorage Blocks.

Result of Inspecting Nonstorage Blocks

When you inspect nonstorage blocks, the display includes this information:

  • Current simulation time

  • Identifier of an entity that is currently advancing through the block. To learn what it means for a nonstorage block to be the location of an entity, see Interpretation of Entity Location.

Depending on the block, the display might also include additional information. For details, see the Block and Description columns of the blk_struct Fields table on the sedb.blkinfo reference page.

Inspect Events

To get details about a particular event on the event calendar:

  1. Find the event identifier using the simulation log or one of the approaches listed in Obtain Event Identifiers.

  2. At the sedebug>> prompt, enter this command, where evid is the event identifier:

    evinfo evid % evid is the identifier.

Alternatively, at the sedebug>> prompt, enter evcal to get details about all events on the event calendar. For more information, see the sedb.evcal reference page.

Obtain Identifiers of Entities, Blocks, and Events

In some state inspection functions, you must refer to an entity, block, or event using its identifier. For background information about identifiers, see Identifiers in the Debugger. The next tables suggest ways to obtain identifiers to use as input arguments in state inspection commands.

Obtain Entity Identifiers

To Display Identifier of Entity Associated with...At sedebug>> Prompt, Enter... Link to Reference Page
The current operationgcensedb.gcen
A particular block whose identifier or path name you knowblkinfo(...). Look in the ID column in the resulting tabular display.sedb.blkinfo
Events on the event calendarevcal. Look in the Entity column in the resulting tabular display.sedb.evcal
A particular event whose identifier you knowevinfo(...). Look at the Entity entry.sedb.evinfo

Obtain Block Identifiers

To Display Identifier of Block Associated with...At sedebug>> Prompt, Enter... Link to Reference Page
The current operationgcebidsedb.gcebid
All blocks whose states you can inspectblklist. Look in the first column in the resulting tabular display.sedb.blklist

Obtain Event Identifiers

To Display Identifier of Event Associated with...At sedebug>> Prompt, Enter... Link to Reference Page
The current operationgcevsedb.gcev
Events on the event calendarevcal. Look in the ID column in the resulting tabular display.sedb.evcal

Was this topic helpful?