• Create Account

### #ActualEralp

Posted 09 January 2013 - 10:42 AM

I am reading the paper "An enhanced recursive frequency splitting broadcasting algorithm for near video-on-demand services" written by Yu-Wei Chen.

There is something which confused me. Here is the algorithm explained as in the paper. And following is the algorithm I wrote in Python. The thing is my algorithm outputs different integers than it is given in the paper as a table. I highly doubt that there is an error or bug in a scientific paper but I can't seem to find the reason. I wanted to get a second opinion before contacting the author.

import math

c = 2
k = 3

subChannelCount = int(math.floor(math.sqrt(c)))
POOL = []

class SlotSequence:
ChannelNumber = 0
p = 0
q = 0

for i in range(k):
for subChannel in range(subChannelCount):
SS = SlotSequence()
SS.ChannelNumber = i
SS.p = subChannel
SS.q = subChannelCount
POOL.append(SS)

j = c

while(len(POOL) > 0):
minMod = 1000000000
minModIndex = -1
for idx,SS in enumerate(POOL):
if SS.q <= j:
if (j % SS.q) < minMod:
minMod = j % SS.q
minModIndex = idx

SS = POOL.pop(minModIndex)
alpha = int(math.floor(j/SS.q))

for x in range(1,alpha):
splitSS = SlotSequence()
splitSS.ChannelNumber = SS.ChannelNumber
splitSS.p = SS.p+x*SS.q
splitSS.q = alpha*SS.q
POOL.append(splitSS)
j = j + 1

print j-c 

### #1Eralp

Posted 09 January 2013 - 10:41 AM

I am reading the paper "An enhanced recursive frequency splitting broadcasting algorithm for near video-on-demand services" written by Yu-Wei Chen.

There is something which confused me. Here is the algorithm explained as in the paper. And following is the algorithm I wrote in Python. The thing is my algorithm outputs different integers than it is given in the paper as a table. I highly doubt that there is an error or bug in a scientific paper but I can't seem to find the reason. I wanted to get a second opinion before contacting the author.


</p><div>import math</div>
<div> </div>
<div>c = 2</div>
<div>k = 3</div>
<div> </div>
<div>subChannelCount = int(math.floor(math.sqrt(c)))</div>
<div>POOL = []</div>
<div> </div>
<div>class SlotSequence:</div>
<div>  ChannelNumber = 0</div>
<div>  p = 0</div>
<div>  q = 0</div>
<div> </div>
<div>for i in range(k):</div>
<div>    for subChannel in range(subChannelCount):</div>
<div>        SS = SlotSequence()</div>
<div>        SS.ChannelNumber = i</div>
<div>        SS.p = subChannel</div>
<div>        SS.q = subChannelCount</div>
<div>        POOL.append(SS)</div>
<div> </div>
<div>j = c</div>
<div> </div>
<div>while(len(POOL) > 0):</div>
<div>    minMod = 1000000000</div>
<div>    minModIndex = -1</div>
<div>    for idx,SS in enumerate(POOL):</div>
<div>        if SS.q <= j:</div>
<div>            if (j % SS.q) < minMod:</div>
<div>                minMod = j % SS.q</div>
<div>                minModIndex = idx</div>
<div>                </div>
<div>    SS = POOL.pop(minModIndex)</div>
<div>    alpha = int(math.floor(j/SS.q))</div>
<div>    </div>
<div>    for x in range(1,alpha):</div>
<div>        splitSS = SlotSequence()</div>
<div>        splitSS.ChannelNumber = SS.ChannelNumber</div>
<div>        splitSS.p = SS.p+x*SS.q</div>
<div>        splitSS.q = alpha*SS.q</div>
<div>        POOL.append(splitSS)</div>
<div>    j = j + 1</div>
<div>    </div>
<div>print j-c</div>
<div> </div>

PARTNERS