Example #1
0
def PerodicPossiblityLearningVsPressure():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makePNode(0.9), Queues)
    resultLQ = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makePNode(0.5), Queues)
    resultLQ2 = mainProcessCtrl(factory=factory,
                                rateList=gobalRateList,
                                threadNum=3)

    for item in ['aveDelay', 'aveDRate']:

        entry = [resultBP[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-o', label='bp')

        entry = [resultLQ[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-v', label='a=0.9')

        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-x', label='a=0.5')

        py.legend(loc=0)
        py.savefig('PerodicPossiblityLearning_with_redo_add_' + item)
        py.close()
Example #2
0
def PaperTwoTest_PerodicPossiblityLearningVsPressure():
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    resultBP = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makePNode(0.9),Queues)
    resultLQ = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makePNode(0.5),Queues)
    resultLQ2 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    labels = {'aveDelay':'Average end-to-end delay',\
                  'aveDRate':'Delivery rate',\
                  'aveHop':'Average hop count',\
                  'aveBacklog':'Per-node queue lengths'}
    
    for item in ['aveDelay','aveDRate','aveHop','aveBacklog']:
        
        entry = [resultBP[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-o',label ='bp')
    
        entry = [resultLQ[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-v',label ='r=0.9')
        
        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-x',label ='r=0.5')
        
        py.xlabel("$\lambda$")
        py.ylabel(labels[item])
        py.legend(loc=0)
        py.savefig('PaperTwoTest_PerodicPossiblityLearning_with_redo_add_'+item)
        py.close()
Example #3
0
def PerodicPossiblityLearningVsPressure():
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    resultBP = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makePNode(0.9),Queues)
    resultLQ = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makePNode(0.5),Queues)
    resultLQ2 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    
    for item in ['aveDelay','aveDRate']:
        
        entry = [resultBP[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-o',label ='bp')
    
        entry = [resultLQ[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-v',label ='a=0.9')
        
        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-x',label ='a=0.5')
        

        py.legend(loc=0)
        py.savefig('PerodicPossiblityLearning_with_redo_add_'+item)
        py.close()
Example #4
0
def PaperTwoTest_PerodicPossiblityLearningVsPressure():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makePNode(0.9), Queues)
    resultLQ = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makePNode(0.5), Queues)
    resultLQ2 = mainProcessCtrl(factory=factory,
                                rateList=gobalRateList,
                                threadNum=3)

    labels = {'aveDelay':'Average end-to-end delay',\
                  'aveDRate':'Delivery rate',\
                  'aveHop':'Average hop count',\
                  'aveBacklog':'Per-node queue lengths'}

    for item in ['aveDelay', 'aveDRate', 'aveHop', 'aveBacklog']:

        entry = [resultBP[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-o', label='bp')

        entry = [resultLQ[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-v', label='r=0.9')

        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-x', label='r=0.5')

        py.xlabel("$\lambda$")
        py.ylabel(labels[item])
        py.legend(loc=0)
        py.savefig('PaperTwoTest_PerodicPossiblityLearning_with_redo_add_' +
                   item)
        py.close()
Example #5
0
def newTest():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makePNode(0.5), Queues)
    resultLQ = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(SPNode, SPQueues)
    resultLQ2 = mainProcessCtrl(factory=factory,
                                rateList=gobalRateList,
                                threadNum=3)

    factory = GridNetworkFactory(makeMNode(2), Queues)
    resultLQ3 = mainProcessCtrl(factory=factory,
                                rateList=gobalRateList,
                                threadNum=3)

    #factory = GridNetworkFactory(makeCNode(1),Queues)
    #resultLQ4 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    for item in ['aveDelay', 'aveDRate']:

        entry = [resultBP[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-o', label='bp')

        entry = [resultLQ[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-v', label='pl=0.5')

        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-x', label='sp=1')

        entry = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-p', label='mm=2')

        #entry = [resultLQ4[key][item] for key in gobalRateList]
        #py.plot(gobalRateList,entry,'-+',label ='ol=1')

        py.legend(loc=0)
        py.savefig('newTest_' + item)
        py.close()
Example #6
0
def newTest():
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    resultBP = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makePNode(0.5),Queues)
    resultLQ = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(SPNode,SPQueues)
    resultLQ2 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makeMNode(2),Queues)
    resultLQ3 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    
    #factory = GridNetworkFactory(makeCNode(1),Queues)
    #resultLQ4 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    
    for item in ['aveDelay','aveDRate']:
        
        entry = [resultBP[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-o',label ='bp')
    
        entry = [resultLQ[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-v',label ='pl=0.5')
        
        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-x',label ='sp=1')
        
        entry = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-p',label ='mm=2')

        #entry = [resultLQ4[key][item] for key in gobalRateList]
        #py.plot(gobalRateList,entry,'-+',label ='ol=1')
        
        py.legend(loc=0)
        py.savefig('newTest_'+item)
        py.close()