使用OMNET++仿真DV—Hop定位算法核心部分的参考源代码-Read.DOCVIP

  • 7
  • 0
  • 约5.69千字
  • 约 6页
  • 2018-11-16 发布于天津
  • 举报

使用OMNET++仿真DV—Hop定位算法核心部分的参考源代码-Read.DOC

使用OMNET仿真DV—Hop定位算法核心部分的参考源代码-Read

使用OMNET++仿真DV—Hop定位算法核心部分的参考源代码如下: #include application.h Define_Module( application ); void application::initialize() { last_seen_id = -1; msgcount = 0; TTL=0; } void application::finish() { int i; double tmp; evNode ID position, px=PX; py=PY\n; for(i=0;iNUM_ANC;i++) { evleast hops to anchor[i]is hopto[i]\n; evlen to anchor[i] is lento[i]\n; } if(ID=NUM_ANC) { commatrix(); tmp=sqrt((PX-rp.rx)*(PX-rp.rx)+(PY-rp.ry)*(PY-rp.ry)); evwe get the position px=rp.rx, py=rp.ry\n; evcha=tmp\n; } else evwe get the position px=PX, py=PY\n; ev\n\n

文档评论(0)

1亿VIP精品文档

相关文档