op_hla_interaction_pk_send()

Note: Requires High-Level Architecture functionality

Abstract

Queues a packet representing an interaction for future delivery to other simulations.

Syntax

op_hla_interaction_pk_send (pk_ptr, delivery_time)
Argument Type Description
pk_ptr Packet * Packet representing the interaction to send
delivery_time double time of delivery of the interaction to other simulations

Return Type

Compcode

Completion code indicating success or failure in queuing the request. The procedure returns OPC_COMPCODE_SUCCESS if the request was successfully queued for later processing by the HLA-PM. It returns OPC_COMPCODE_FAILURE if the request could not be queued.

Example

static void send_reply (void)
	{
	Packet * reply;

	. . .

	reply = op_pk_create_fmt ("Info_Reply");

	. . .

	op_pk_nfd_set (reply, "opnet id", my_id);

	. . .

	op_hla_interaction_pk_send (pd, OPC_HLA_DELIVER_NOW);
	}

Details

HLA interactions are C++ objects. Using a packet format provides all process models with the ability to generate interactions without having to deal with the actual encoding of interaction components.

Using the constant OPC_HLA_DELIVER_NOW for the delivery time indicates to the HLA-PM that the interaction should be delivered to other simulations at the earliest possible time based on the current simulation time and the lookahead used by the simulation.

Purpose

Provides a mechanism to generate an HLA interaction to be delivered to other simulation when the simulation time reaches delivery_time. The packet pk_ptr will be converted to the interaction format by the HLA-PM.

Errors

  • Recoverable Error: Unable to queue outgoing interaction packet.
  • Recoverable Error: Interaction delivery time (<time>) must be at least current time + lookahead (<time>).

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com