-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbit-reversal_demo.html
75 lines (66 loc) · 2.8 KB
/
bit-reversal_demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html id="htmlId">
<head>
<title>Bit-reversal RBO demo</title>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52437368-4', 'auto');
ga('send', 'pageview');
</script>
<style>
div, p{
padding: 1em;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
header, footer {
padding: 1em;
color: white;
background-color: #159957;
clear: left;
text-align: center;
}
</style>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-52437368-4', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<script src="js/mySVG.js"></script>
<script src="js/rbo.js"></script>
<script src="bit-reversal_demo.js"></script>
<svg id="mySVG" width="100" height="100" style="background-color:white;">
</svg>
<script>
mySVG=document.querySelector("#mySVG");
// var k=5; // k-bit-reversal
// var s=0; // initial starting point
// var step=10; // unit distance in pixels
// drawRboTreesAnimate(mySVG, k,s, step); // starting the animation - updates animatorId global variable
drawRboTreesAnimate(mySVG, 5,0, 10); // starting the animation - updates animatorId global variable
</script>
<div>
<button type="button" onclick="clearTimeout(animatorId);drawRboTreesAnimate(mySVG, 4,0, 10);">4 bits</button>
<button type="button" onclick="clearTimeout(animatorId);drawRboTreesAnimate(mySVG, 5,0, 10);">5 bits</button>
<button type="button" onclick="clearTimeout(animatorId);drawRboTreesAnimate(mySVG, 6,0, 10);">6 bits</button>
<button type="button" onclick="clearTimeout(animatorId);">STOP</button>
</div>
<p>
This animation displays binary trees on the graph of a bit-reversal function.
The trees show decompositions of time-slots of the first receiver's cycle
(between the red lines) for various starting times in the analysis of
<a href="https://sites.google.com/site/rboprotocol/" target="_blank">RBO broadcast scheduling</a>.
</p>
<footer><a href="https://mki1967.github.io/">mki1967.github.io<a> </footer>
</body>
</html>