Git Product home page Git Product logo

dawn-sim's Introduction

DAWN-Sim

A Simple Distributed Algorithm Simulator for Research and Teaching. The simulator is based on WsnSimPy. It has also visualized version in it.

Pre-requirements

Install SimPy library

pip install simpy

Examples

There are three examples which are flood, flood_vis, and aodv. The flood and flood_vis examples simulate the flooding algorithm. The flood_vis is a visualized version of the flood example. The aodv simulates the AODV routing algorithm in the visualized version. Execute them via command line:

python -m flood.py

Flooding Demonstration

python -m flood_vis.py

Flooding Demonstration

python -m aodv_vis.py

Flooding Demonstration

How to use

Step 1: Import DawnSim.

from source import DownSim

Step 2: Create a node class that inherits DawnSim.BaseNode to simulate a single node.

class MyNode(DownSim.BaseNode):
    pass

Step 3: Override init(), run(), on_receive(pck), and finish() functions (only the necessary ones).

class MyNode(DownSim.BaseNode):
    def run():
        pck = {'var1': 'val1', 'var2', 'val2'}
        self.send(DawnSim.BROADCAST_ADDR, pck)

Step 4: Create a new DawnSim.Simulator object.

my_sim = DawnSim(duration = 100)

Step 5: Add nodes into the simulator via add_node() function.

my_sim.add_node(MyNode, pos = (50, 50), tx_range = 75)
my_sim.add_node(MyNode, pos = (50, 100), tx_range = 75)

Step 6: Call the run() to start the simulation.

my_sim.run()

Citation

Tosun, M., Cabuk, U. C., Dagdeviren, O., & Ozturk, Y. (2023, February). DAWN-Sim: A Distributed Algorithm Simulator for Wireless Ad-hoc Networks in Python. In 2023 International Conference on Computing, Networking and Communications (ICNC). IEEE.

dawn-sim's People

Contributors

mustafatosun 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.