Example #1
0
import schemes
if __name__ == '__main__':
    #print node.wp
    wp = [5, 7, 10, 20, 50, 100]
    nodeList = buildNetworkFromTopo(topoFile)
    nodeList = hopCountCalc(nodeList)
    updatePrevHopNeighbors(nodeList)
    for eachWP in wp:
        wP = int(eachWP)
        treebuild.timeslotAllocFree(nodeList, eachWP)
        #del pnodeList
        #============for lEOT===============
        #print "Tree build"
        lnodeList = treebuild.lEOT(nodeList)
        #print "Active Time calc"
        treebuild.firstActiveTime(lnodeList, wP)
        #print "pmf"
        treebuild.pmfCalculation(lnodeList)
        #print "Dp"
        treebuild.Dp(lnodeList, wP)
        #print "Build sender set"
        treebuild.buildSenderSet(lnodeList)
        linkDelayFile = "stats\dutycycle\length%s_linkDelay.txt" % (eachWP)
        linkNumTFile = "stats\dutycycle\length%s_linkNumT.txt" % (eachWP)
        schemes.runOF(lnodeList, wP, 100, linkDelayFile, linkNumTFile)
        #del lnodeList
        
        #============for pEOT===============
        #print "Tree build"
        pnodeList = treebuild.pEOT(nodeList)
        #print "Active Time calc"
Example #2
0
nodeList[3].linkToNeighbors.update({5:0.8})
nodeList[5].neighbors.append(nodeList[6])
nodeList[6].neighbors.append(nodeList[5])
nodeList[5].linkToNeighbors.update({6:0.7})
nodeList[6].linkToNeighbors.update({5:0.7})
nodeList[5].neighbors.append(nodeList[7])
nodeList[7].neighbors.append(nodeList[5])
nodeList[5].linkToNeighbors.update({7:0.8})
nodeList[7].linkToNeighbors.update({5:0.8})
for i in range (0, len(nodeList)):
	nodeList[i].ID = i
	
nodeList = hopCountCalc(nodeList)
updatePrevHopNeighbors(nodeList)

nodeList[0].timeSlot = 0
nodeList[1].timeSlot = 1
nodeList[2].timeSlot = 3
nodeList[3].timeSlot = 2
nodeList[4].timeSlot = 4
nodeList[5].timeSlot = 2
nodeList[6].timeSlot = 3
nodeList[7].timeSlot = 0

pnodeList = treebuild.pEOT(nodeList)
lnodeList = treebuild.lEOT(nodeList)

treebuild.firstActiveTime(pnodeList)
treebuild.pmfCalculation(pnodeList)
treebuild.Dp(pnodeList)