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

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

    factory = GridNetworkFactory(makeCNode(10),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 ='lq=1')
        
        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-x',label ='lq=10')
        

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

    factory = GridNetworkFactory(makeCNode(2), Queues)
    resultLQ = 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='M=2')

        py.xlabel("$\lambda$")
        py.ylabel(labels[item])
        py.legend(loc=0)
        py.savefig('PaperTwo_onePassLearning_' + item)
        py.close()
Exemple #3
0
def Test():
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #print result
    py.plot(gobalRateList,result,'-o',label ='bp')

    #factory = GridNetworkFactory(makeSimpleNode(),ShadowQueues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-v',label ='sq')

    #factory = GridNetworkFactory(makeOMNode(1),Queues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-+',label ='om')

    #factory = GridNetworkFactory(makeMNode(2),Queues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-*',label ='mm=2')
    

    #factory = GridNetworkFactory(makeMNode(4),ShadowQueues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-s',label ='ms=4')
    
    py.legend(loc=0)
    py.show()
Exemple #4
0
def paperOneTestDA():
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    resultBP = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)


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

    factory = GridNetworkFactory(makeMNode(4),Queues)
    resultLQ3 = 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 = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-x',label ='K=10')
        
        entry = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-p',label ='M=4')

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

    factory = GridNetworkFactory(SPNode,SPQueues)
    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 ='K=10')
        
        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_DA_'+item)
        py.close()
Exemple #6
0
def NewQueuesTest():
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    resultBP = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makeNewNode(1),NewQueues)
    resultLQ = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

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

    factory = GridNetworkFactory(makeNewNode(0.8),NewQueues)
    resultLQ3 = 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 ='nq=1')

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


        
        
        py.legend(loc=0)
        py.savefig('newQueuesTest_'+item)
        py.close()
Exemple #7
0
def Test():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    result = mainProcessCtrl(factory=factory,
                             rateList=gobalRateList,
                             threadNum=3)
    #print result
    py.plot(gobalRateList, result, '-o', label='bp')

    #factory = GridNetworkFactory(makeSimpleNode(),ShadowQueues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-v',label ='sq')

    #factory = GridNetworkFactory(makeOMNode(1),Queues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-+',label ='om')

    #factory = GridNetworkFactory(makeMNode(2),Queues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-*',label ='mm=2')

    #factory = GridNetworkFactory(makeMNode(4),ShadowQueues)
    #result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)
    #py.plot(gobalRateList,result,'-s',label ='ms=4')

    py.legend(loc=0)
    py.show()
Exemple #8
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()
Exemple #9
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()
Exemple #10
0
def onePassLearningVsPressure():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

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

    factory = GridNetworkFactory(makeCNode(10), 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='lq=1')

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

        py.legend(loc=0)
        py.savefig('onePassLearning_' + item)
        py.close()
Exemple #11
0
def oneRoundDelay(step = 10000):
    injectRate = 0.9
    factory = GridNetworkFactory(makeSimpleNode(),Queues)
    factory.constructNetwork(6,6)\
        .setFlow(Flow((0,0),(0,5),injectRate))\
        .setFlow(Flow((5,0),(5,5),injectRate))\
        .setFlow(Flow((2,0),(3,5),injectRate))

    network = factory.getNetwork()

    packetFactory = PacketFactory()
    simulator = \
        Simulator(network,step,ConstLinkRateGenerator(1),packetFactory)
    simulator.run()
    #simulator.printNetwork()
    stat = simulator.getStaticsInfo()
    print stat['aveDelay']
    packetPool = sorted(stat['packetPool'],key=lambda p: p.getID)


    
    py.subplot(211)
    py.vlines([p.getCreateTime() for p in packetPool],[1],[p.getDelay() for p in packetPool],'r')
    py.xlabel('Packet create time(bp with $\lambda$ = 0.9)')
    py.ylabel('delay')
    py.grid(True)




    injectRate = 0.9
    factory = GridNetworkFactory(makeMNode(2),Queues)
    factory.constructNetwork(6,6)\
        .setFlow(Flow((0,0),(0,5),injectRate))\
        .setFlow(Flow((5,0),(5,5),injectRate))\
        .setFlow(Flow((2,0),(3,5),injectRate))

    network = factory.getNetwork()

    packetFactory = PacketFactory()
    simulator = \
        Simulator(network,step,ConstLinkRateGenerator(1),packetFactory)
    simulator.run()
    #simulator.printNetwork()

    stat = simulator.getStaticsInfo()
    print stat['aveDelay']
    packetPool = sorted(stat['packetPool'],key=lambda p: p.getID)

    py.subplot(212)
    py.vlines([p.getCreateTime() for p in packetPool],[1],[p.getDelay() for p in packetPool],'b')
    py.xlabel('Packet create time (m=2 with $\lambda$ = 0.9)')
    py.ylabel('delay')
    py.grid(True)
    py.savefig('packetDelayInOneRound_09')
    py.show()
Exemple #12
0
def oneRoundDelay(step=10000):
    injectRate = 0.9
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    factory.constructNetwork(6,6)\
        .setFlow(Flow((0,0),(0,5),injectRate))\
        .setFlow(Flow((5,0),(5,5),injectRate))\
        .setFlow(Flow((2,0),(3,5),injectRate))

    network = factory.getNetwork()

    packetFactory = PacketFactory()
    simulator = \
        Simulator(network,step,ConstLinkRateGenerator(1),packetFactory)
    simulator.run()
    #simulator.printNetwork()
    stat = simulator.getStaticsInfo()
    print stat['aveDelay']
    packetPool = sorted(stat['packetPool'], key=lambda p: p.getID)

    py.subplot(211)
    py.vlines([p.getCreateTime() for p in packetPool], [1],
              [p.getDelay() for p in packetPool], 'r')
    py.xlabel('Packet create time(bp with $\lambda$ = 0.9)')
    py.ylabel('delay')
    py.grid(True)

    injectRate = 0.9
    factory = GridNetworkFactory(makeMNode(2), Queues)
    factory.constructNetwork(6,6)\
        .setFlow(Flow((0,0),(0,5),injectRate))\
        .setFlow(Flow((5,0),(5,5),injectRate))\
        .setFlow(Flow((2,0),(3,5),injectRate))

    network = factory.getNetwork()

    packetFactory = PacketFactory()
    simulator = \
        Simulator(network,step,ConstLinkRateGenerator(1),packetFactory)
    simulator.run()
    #simulator.printNetwork()

    stat = simulator.getStaticsInfo()
    print stat['aveDelay']
    packetPool = sorted(stat['packetPool'], key=lambda p: p.getID)

    py.subplot(212)
    py.vlines([p.getCreateTime() for p in packetPool], [1],
              [p.getDelay() for p in packetPool], 'b')
    py.xlabel('Packet create time (m=2 with $\lambda$ = 0.9)')
    py.ylabel('delay')
    py.grid(True)
    py.savefig('packetDelayInOneRound_09')
    py.show()
Exemple #13
0
def otherTest():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makeNewNode(0.8), NewQueues)
    resultLQ = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makeNewNode(0.8), TestQueues)
    resultLQ2 = mainProcessCtrl(factory=factory,
                                rateList=gobalRateList,
                                threadNum=3)

    factory = GridNetworkFactory(makeNewNode(0.8), TestSquareQueues)
    resultLQ3 = 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='original')

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

        entry = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-+', label='squareRule')

        py.xlabel("$\lambda$")
        py.ylabel(labels[item])
        py.grid(True)
        py.legend(loc=0)
        py.savefig('otherTest_' + item)
        py.close()
Exemple #14
0
def paperOneTestSA():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

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

    factory = GridNetworkFactory(makeMNode(4), Queues)
    resultLQ4 = mainProcessCtrl(factory=factory,
                                rateList=gobalRateList,
                                threadNum=3)

    factory = GridNetworkFactory(makeMNode(6), Queues)
    resultLQ5 = 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 = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-p', label='M=2')

        entry = [resultLQ4[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-x', label='M=4')

        entry = [resultLQ5[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-x', label='M=6')

        py.xlabel("$\lambda$")
        py.ylabel(labels[item])
        py.legend(loc=0)
        py.savefig('PaperOneTest_sameAlgorithms_' + labels[item])
        py.close()
Exemple #15
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()
Exemple #16
0
def PaperThree_NewQueuesTest_DA():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

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

    factory = GridNetworkFactory(makeNewNode(0.8), NewQueues)
    resultLQ3 = 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 = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList, entry, '-p', label='r=0.8')

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

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

    factory = GridNetworkFactory(makeNewNode(0.8),NewQueues)
    resultLQ = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makeNewNode(0.8),TestQueues)
    resultLQ2 = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3)

    factory = GridNetworkFactory(makeNewNode(0.8),TestSquareQueues)
    resultLQ3 = 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 ='original')
        
        entry = [resultLQ2[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-x',label ='doubleRule')

        entry = [resultLQ3[key][item] for key in gobalRateList]
        py.plot(gobalRateList,entry,'-+',label ='squareRule')
        
        py.xlabel("$\lambda$")
        py.ylabel(labels[item])
        py.grid(True)
        py.legend(loc=0)
        py.savefig('otherTest_'+item)
        py.close()
Exemple #18
0
def NewQueuesTest():
    factory = GridNetworkFactory(makeSimpleNode(), Queues)
    resultBP = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

    factory = GridNetworkFactory(makeNewNode(1), NewQueues)
    resultLQ = mainProcessCtrl(factory=factory,
                               rateList=gobalRateList,
                               threadNum=3)

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

    factory = GridNetworkFactory(makeNewNode(0.8), NewQueues)
    resultLQ3 = 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='nq=1')

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

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

        py.legend(loc=0)
        py.savefig('newQueuesTest_' + item)
        py.close()
Exemple #19
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()