op_ima_traj_speed_set()

Abstract

Sets the speed at which a specified object follows its trajectory.

Syntax

op_ima_traj_speed_set (objid, speed_m_s, for_current_segment_only)
Argument Type Description
objid Objid object ID of the site of interest; must be a mobile node or mobile subnet
speed_m_s double speed, in meters per second
for_current_segment_only int whether the speed applies to the current segment (TRUE) or all of the trajectory (FALSE)

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the speed 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 override the speed specified by a trajectory. You can specify a speed for the current segment or all of the remaining trajectory.

This KP lets you override the speed at any time during a simulation. You can also set the trajectory speed prior to running the simulation by setting the “trajectory_speed_override“ attribute on a specific mobile site.

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