op_ima_traj_set()

Abstract

Sets the trajectory for an object.

Syntax

op_ima_traj_set (objid, traj_filename, wait_time)
Argument Type Description
objid Objid object ID of the site of interest; must be a mobile node or mobile subnet
traj_filename const char * name of the trajectory to set
wait_time double time to wait from the current simulation time before starting to follow the trajectory, in seconds

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the new trajectory is set; OPC_COMPCODE_FAILURE otherwise.

Example

double duration = op_ima_traj_remaining_duration_get (subnet_objid);
if (duration == 0)
   {
   op_ima_traj_set (subnet_objid, "NE_zig_zag", 0.0);
   op_ima_traj_speed_set (subnet_objid, op_dist_uniform (100.0) + 10.0, VOSC_FALSE);
   }

Details

None.

Purpose

Provides a way to assign a trajectory to a mobile site (node or subnet) during a simulation. You can call this KP at any time to assign a new trajectory or replace the current one on the site. Thus, you can use this KP to have a site follow a series of trajectories in sequence or to change the trajectory being followed in response to changing conditions in the simulation.

Errors

  • Recoverable Error: Object ID (<objid>) is out-of-range.
  • Recoverable Error: Object ID (<objid>) refers to a restricted object.
  • Recoverable Error: Object (<objid>) has incorrect type (<type>); mobile sites are expected.

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