ONE源代码分析——core3之DTNHost类
来源:互联网 发布:乌鸦森林之谜 mac 编辑:程序博客网 时间:2024/04/24 01:19
DTNHost类代表的是仿真世界中的节点,也是ONE最重要的类之一。
数据域:
int address:节点地址
Coord location:节点的位置
Coord destination:节点目的地
MessageRouter router:节点路由协议
MovementModel movement:节点采用的移动模型
Path path:节点路径
double speed:移动速度
double nextTimeToMove:下一次移动的时间
String name:节点名称
List<MessageListener> msgListeners:MessageListener列表
List<MovementListener> movListener:MovementListener列表
List<NetworkInterface> net:节点网络接口列表
ModuleCommunicationBus comBus:通信模型总线
函数域:
构造函数:节点location由移动模型中函数getInitialLocation()定义,nextTimeToMove由移动模型中函数nextPathAvailable()定义。
void forceConnection(DTNHost anotherHost, String interfaceID, boolean up):强制连接某个节点的某个接口
void move(double timeIncrement):possibleMovement表示在timeIncrement时间段内,节点可能移动的距离,如果大于到节点的目的距离,则节点移动到目的地,通过setNextWaypoint()根据移动模型确定下一个目的地。如果没有新的目的地,则返回;若有新的目的地,继续计算当前location(前面一次的目的地)到更新后的目的地的距离,再与减去之前移动距离的possibleMovement比较,循环往复,直到possiblemovement小于当前的location到目的地的距离。
- ONE源代码分析——core3之DTNHost类
- ONE源代码分析——core2之World类
- ONE源代码分析——movement2之MapBasedMovement
- ONE源代码分析——movement3之MapRouteMovement
- ONE源代码分析——movement4之BusMovement
- ONE源代码分析——movement5之RandomWaypoint
- ONE源代码分析——movement6之ShortestPathMapBasedMovement
- ONE源代码分析——movement7之PointsOfInterest
- ONE源代码分析——movement8之EveningActivityMovement
- ONE源代码分析——router1之MessageRouter
- ONE源代码分析——core4之Message
- ONE源代码分析——router2之ActiveRouter
- ONE源代码分析——core5之Connection
- ONE源代码分析——core6之ModuleCommunicationBus
- ONE源代码分析——Report2之MessageDelayReport
- ONE源代码分析——core7之SimScenario
- ONE源代码分析——router之Prophetrouter
- ONE源代码分析——core1
- Win7下Eclipse中文字体太小
- sql分组后取第一条记录
- 图像配准概论
- python获取CSDN个人收藏的文章链接和标题,然后发送到指定邮件
- 在Android应用中使用自定义证书的HTTPS连接
- ONE源代码分析——core3之DTNHost类
- android的消息处理机制(图+源码分析)——Looper,Handler,Message
- SQL_实验1.5 清华大学出版社
- javascript
- 使用Thread、Runnable、Handler
- STL中vector自定义对象的排序、删除
- jquery设置元素的readonly和disabled
- 解决低版本ie下li:hover不支持的问题
- -e shell