mapa17 / Eruliaf

A BitTorrent like overlay peer simulator
GNU General Public License v3.0
1 stars 0 forks source link

Adapt slotCount calculation function #52

Closed mapa17 closed 12 years ago

mapa17 commented 12 years ago

At the moment the function is calculating the number of OU and TFT slots by

# http://www.wolframalpha.com/input/?i=plot%2C+int%28+atan%280.20%28x-15%29%29+*+8+%29+%2C+x+%3D+%5B0%2C100%5D

nMaxTFTSlots = int( math.atan(0.20*(x-15.0)) * 8 )  
if(nMaxTFTSlots < 0): nMaxTFTSlots = 0

# http://www.wolframalpha.com/input/?i=plot+%2C+int%28+%288+-+%28%28+atan%280.15*x+-+2%29+*+0.5+%29+%2B+0.5%29*4%29+%2B+1%29+%2C+x%3D%5B0%2C+100%5D
nMaxOUSlots = int( (8 - (( math.atan(0.15*x - 2) * 0.5 ) + 0.5)*4) + 1) 

if(x > 15):
            nMaxOUSlots = nMaxOUSlots / ((ouPhaseCnter  % 4) + 1) #Circulate nMaxOUSlots between 1 and 4 slots
            nMaxOUSlots = int(nMaxOUSlots)

The TFT Algorithm will be changed to the following

http://www.wolframalpha.com/input/?i=plot%2C+int%28+atan%280.08%28x%29%29+*+5+%29+%2C+x+%3D+%5B0%2C100%5D

raning from [1,7] TFT slots. Starting out with 1 near to zero piece availability and having 3-4 tft during the critical 10-15 % piece availability.

The OU slot calculation will be unchanged.

mapa17 commented 12 years ago

And the lower limit of TFT Slots will be set to one!

mapa17 commented 12 years ago

Something is wrong with the TFT slot calculation. The max TFT six, it should be higher ...

mapa17 commented 12 years ago

Moving to Milestone "Simulation V7"

mapa17 commented 12 years ago

With a piece availability of 50%, there are max 6 TFT and 4 OU Slots. Using 40% for OU is too much.