op_ima_traj_remaining_duration_get()
Abstract
Obtains the time remaining until a specified object reaches the end of the trajectory it is following.
Syntax
op_ima_traj_remaining_duration_get (objid)
| Argument | Type | Description |
|---|---|---|
objid |
Objid |
object ID of the site of interest; must be a mobile node or mobile subnet |
Return Type
double
Remaining time on the trajectory, in seconds.
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 determine how much time remains until a mobile site (node or subnet) reaches the end of the trajectory it is following, including any repeats or reversals.
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. - Recoverable Error: Object (
<objid>) has no trajectory. - Recoverable Error: Object (
<objid>)'s trajectory is a vector. This operation is not valid on vectors.
Reference
- Use the KP op_ima_traj_info_get() to get the current speed and ascent rate of a site and the time until one of these changes
- Use the KP op_ima_traj_set() to assign a new trajectory to a site
- Use the KP op_ima_traj_speed_set() to override the speed set by the trajectory