全部博文(25)
分类: 系统运维
2008-03-28 11:44:44
Sets a callback to return the position of a mobile site that is not following a trajectory or vector.
The callback is a custom procedure that computes the latitude, longitude, and altitude of a site given a requested time and the previous position and time. The requested time can be the current simulation time or some future time. The callback prototype is:
typedef void
(*SimT_Ima_Obj_Position_Query_Proc)(SimT_Objid site_id,
void * state_ptr, double prev_time, double prev_latitude,
double prev_longitude, double prev_altitude_in_meters,
double request_time, double * lat_ptr, double * long_ptr,
double * alt_in_meters_ptr);
Normally, the Simulation Kernel uses whatever position was last
set for nodes that aren't following a trajectory or vector. This KP registers a
callback for a specific mobile site (node or subnet) that enables the Simulation
Kernel to obtain an exact position whenever needed.
Experiment
A node is made to use op_ima_obj_pos_query_proc_set.
src represents simple_source.pr.m while pos uses op_ima_obj_pos_query_proc_set to set the callback. The callback is defined as
|
If src generates traffic, the callback is called and the position is printed.
|
prev_time, curr_time, are the time points at which the packets are sent. If you set different inter-arrival time parameter for src, these two arguments will have different values, hence different output from that shown above.