Giter Site home page Giter Site logo

net_tinyos_prowler's Introduction

模拟无线传感器网络

第四次迭代

  1. 为每条message增加序列号(增加类Message,有seqId,content,ttl三个属性)
  2. 为每个结点增加缓存cache,因为这里只有一个节点发了一条消息,其他节点只是在转发同一条消息,所以看不出效果。
  3. 为数据包增加TTL(time to live)设置,为结点增加数据包生命期检查。ttl越大,消息传播越远,设为1000时与第2次迭代后执行结果相同。
  4. 更新内容:将主函数独立出来,放到RunSimulation.java类中,维持TestBroadcastNode.java功能的清晰性。

第五次迭代

  1. 主要是增加了前端展示功能
  2. 前段可以指定numCount数目,并通过start按钮让后端以此数目运行仿真引擎。
    1. 新增功能:start后,每隔1秒向后端获取网络状态,并实时更新显示,获取20次。
  3. 增加stop按钮,通过此按钮可以让后端停止仿真引擎线程,防止过多的线程导致计算机资源不足。每次start后应该记得stop一下,再开始新的start。
    1. 新增功能:增加判断,保证一次只能有一个仿真引擎线程在跑。

第六次迭代

  1. 主要是统计网络中所有的生命期走到终止的message(corrupted=true或msg_ttl=0),与第四次迭代相关,增加了ttl
  2. 包括三种:
    1. 成功到达(sent)
    2. 半途因缓冲队列容量满被drop(因为自始至终只有一条信息在传播,故为0)
    3. 生命期终止被drop(这个应该要基于第四次迭代,msg_ttl=0)
  3. 除了增加了Python的mian.py函数之外,还需要修改Java的LogQueue.java的格式,以便Python读取内容。我增加一些LogQueue.java的内容,比如msg_ttl,以便统计。

net_tinyos_prowler's People

Contributors

rzzhimo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.