How do I access the value of compound attributes in a simulation?

Categories:
Solution Number:
S20697
Last Modified:
2013-08-20
Issue

How do I access the value of compound attributes in a simulation?

Solution

There is a hierarchy to the attributes of objects in OPNET. Compound attributes are made up of several rows and columns. Each row of this table is another object, with the the fields being attributes of the row object. To set the valuesof a compound attribute we must obtain a pointer to each of the objects in the hierarchy until we get to the attribute we want to set. For example, many links have a compound attribute named background utilization. In the example code below, we get each time attribute value from each row of the background utilization compound object./* Get the compound attribute background utilization from the link object. */op_ima_obj_attr_get (link_objid, background utilization, &bgutil_compound_objid);/* Determine how many rows are in the background utilization compound object. */row_count = op_topo_child_count (bgutil_compound_objid, OPC_OBJTYPE_GENERIC);/* Loop over each row and get the time values. */for (row_index = 0; row_index < row_count; row_index++) { /* get the row object. */ row_objid = op_topo_child (bgutil_compound_objid, OPC_OBJTYPE_GENERIC, row_index); /* get the time attribute vale for this row.*/ op_ima_obj_attr_get (row_objid, time, &time); /* we now have this time value, which we could store in an array, list, etc. */ }You would use similar code if you were trying to access, for example, the subqueues of a queue module.For an overview of the compound object hierarchy, please read the Compound Attributes section of the Online Documentation. To get to the Online Documentation, use the Help menu:Help -> Online DocumentationIn Acrobat:Modeling Concepts -> Modeling Framework -> Modeling System Structure ->Attributes ->Compound AttributesIf you have additional questions, please contact your Technical Support Representative.

Environment

DES Kernel->Process Modeling/Coding,DES Kernel->Statistics and Reports

Attachments
NOTICE: Riverbed® product names have changed. Please refer to the Product List for a complete list of product names.
Can't find an answer? Create a case