Package Overview
The Id (Identification) package is a collection of Kernel Procedures concerned with obtaining object IDs for simulation objects. Object IDs are a key aspect of Kernel Procedures, because a large number of KPs operate on objects that are specified via their object ID. An object ID is an integer that uniquely identifies a single object within a simulation; all simulation objects share a common object ID numbering space (for example, there can only be one object #5, whether it is a node or a queue). You can determine if an object ID is valid with the KP op_id_check().
Processes often need to determine the object ID of the processor or queue on which they are executing. This service is provided by the KP op_id_self(). Within simulations, processes are not considered objects, so the object ID that a process considers its “own” (the self ID) is actually the object ID of the surrounding processor or queue.
Simulation objects have a hierarchical relationship, with objects conceptually contained within other objects. When an object is contained within another, the encompassing object is termed the parent, and the contained object is termed the child. For example, nodes are the parents of modules, and subnets are the parents of nodes and links.
There are several different labels available for network-domain objects (i.e., nodes, links, and subnets), the most common being the object’s name (a character string) and its object ID (an integer). Another type of network object label is the system ID, which is a unique integer serial number for each object within the set of objects of the same type. A fourth type of network object label is the user ID, which is a user-assigned integer which does not have any uniqueness requirement.
A set of KPs are available to convert alternate object labels into object IDs. The KP op_id_from_userid() similarly obtains the object ID of a network-domain object based on its user ID. The KP op_id_from_name() obtains an object ID based on the object’s parent, type, and name; op_id_from_hierarchical_name() does the same using the hierarchical name. The reverse conversions of object ID into alternate object labels are not supported by Id package KPs, because these alternate labels are object attributes that can be conveniently obtained through the Ima package.
Sometimes a process obtains an object ID for an object it is not familiar with. In these instances, the KP op_id_to_type() can be used to determine the type of an object based on its ID.
The Topo package of KPs also provides a number of services related to the determination of object IDs, including parent and child object IDs as well as the IDs of connected or connecting objects.
A summary of the object-hierarchy rules that apply in the use of Id package KPs is given below:
- Each object can be viewed as a child of a single object that contains it, and possibly the parent of one or more objects which it contains.
- Network-domain objects consist of subnets, nodes, links, and taps.
- The “top” subnet has an object ID of 0; it is the ultimate “grand-parent” of all lower domain objects.
- Nodes, links, and taps are children of the subnet which contains them (hence nodes and links within the top-level view are children of the top-level subnet).
- Node-domain objects are modules (processors, queues, generators, receivers, transmitters, and antennas). Modules are children of the node that contains them.
- Modules cannot contain other modules, so they are never the parent or the child of another module.
- Certain modules contain submodule objects which are their children: subqueues are the children of queues, channels are the children of receivers and transmitters. Submodule objects do not have names, but they do have object IDs.
- Processes are not objects; the processor or queue on which a process runs is the “self” object from the perspective of the process.