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()
def PaperThree_NewQueuesWithLimitsTest_SA(): results = [] for rate in [0.2, 0.4, 0.8, 1]: factory = GridNetworkFactory(makeNewNode(rate), NewQueues) result = mainProcessCtrl(factory=factory, rateList=gobalRateList, threadNum=3) results.append((rate, result)) 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']: for rate, result in results: entry = [result[key][item] for key in gobalRateList] py.plot(gobalRateList, entry, label='r=%.1f' % rate) py.xlabel("$\lambda$") py.ylabel(labels[item]) py.legend(loc=0) py.savefig('PaperThree_SA_' + item) py.close()
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()
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()
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()
def NewQueuesWithLimitsTest(): results = [] for rate in [0.2,0.4,0.8,1]: factory = GridNetworkFactory(makeNewNode(rate),NewQueues) result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3) results.append((rate,result)) for item in ['aveDelay','aveDRate']: for rate,result in results: entry = [result[key][item] for key in gobalRateList] py.plot(gobalRateList,entry,label ='nq=%.1f'%rate) py.legend(loc=0) py.savefig('newQueuesTest_differentLimits_'+item) py.close()
def NewQueuesWithLimitsTest(): results = [] for rate in [0.2, 0.4, 0.8, 1]: factory = GridNetworkFactory(makeNewNode(rate), NewQueues) result = mainProcessCtrl(factory=factory, rateList=gobalRateList, threadNum=3) results.append((rate, result)) for item in ['aveDelay', 'aveDRate']: for rate, result in results: entry = [result[key][item] for key in gobalRateList] py.plot(gobalRateList, entry, label='nq=%.1f' % rate) py.legend(loc=0) py.savefig('newQueuesTest_differentLimits_' + item) py.close()
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()
def PaperThree_NewQueuesWithLimitsTest_SA(): results = [] for rate in [0.2,0.4,0.8,1]: factory = GridNetworkFactory(makeNewNode(rate),NewQueues) result = mainProcessCtrl(factory=factory,rateList=gobalRateList,threadNum=3) results.append((rate,result)) 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']: for rate,result in results: entry = [result[key][item] for key in gobalRateList] py.plot(gobalRateList,entry,label ='r=%.1f'%rate) py.xlabel("$\lambda$") py.ylabel(labels[item]) py.legend(loc=0) py.savefig('PaperThree_SA_'+item) py.close()
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()