An open API service indexing awesome lists of open source software.

https://github.com/ztrehagem/dummy-leach-algorithm


https://github.com/ztrehagem/dummy-leach-algorithm

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

LEACHのアルゴリズムを簡単に実装した

# Setup
1. Node.jsをインストール
2. このリポジトリをクローン

# Testing
1. このリポジトリルートで `npm run test`

# Execution Result

```
------------round------------
cluster numbers: 10
head 3 : 4, 14, 19, 26, 35, 60, 76, 82, 85, 93
head 24 : 39, 66
head 28 : 2, 10, 20, 51, 58, 69, 77
head 29 : 6, 27, 92
head 36 : 0, 1, 11, 43, 44, 47, 50, 54, 57, 59, 68, 72, 73, 88, 90, 97
head 40 : 8, 13, 17, 21, 25, 30, 37, 41, 46, 53, 61, 75, 81, 83, 84, 86, 87, 89, 99
head 56 : 12, 38, 55, 67, 95, 98
head 63 : 15, 22, 23, 31, 49, 62, 70, 80
head 71 : 5, 7, 9, 33, 34, 42, 48, 52, 64, 65, 74, 78, 96
head 94 : 16, 18, 32, 45, 79, 91
all cluster-heads are received all messages in 500ms: true
```

これを20回繰り返す.
P=0.1として設定されているので,各ノードが2回ずつクラスタヘッドになる.