当前位置: 首页>>代码示例>>Python>>正文


Python Simulator.genPoints方法代码示例

本文整理汇总了Python中Simulator.Simulator.genPoints方法的典型用法代码示例。如果您正苦于以下问题:Python Simulator.genPoints方法的具体用法?Python Simulator.genPoints怎么用?Python Simulator.genPoints使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Simulator.Simulator的用法示例。


在下文中一共展示了Simulator.genPoints方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: doT1nT2n

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
    def doT1nT2n(self,Community_Coordinate):
        nPnt= 10   #1000
        nLink= 11  #40
        
        tests=""
        s=Simulator(nPnt)
        s.genPoints(Community_Coordinate)
        #s.genRandomLinks(nLink*nPnt)

        return s.pAll
        
        
##        f2=    open('doT1nT2n2.txt', 'w')
##        for i in range(0,100):
##            for j in range(0,i+1):   
##                nSteps=self.MutiTimesNoGen(s,1,i,j,0.5,0.2)
##                print str(i)+"\t"+ str(j) +"\t"+str(nSteps)
##                f2.write(str(i)+"\t"+ str(j) +"\t"+str(nSteps)+"\n")
##                tests=tests+str(nSteps)+"\t"
##            for j in range(i,101):  
##                tests=tests+"0\t"
##            tests=tests+("\n")    
##        f = open('doT1nT2n.txt', 'w')
##        f.write(tests)
                  
        return    
开发者ID:sagarjhaa,项目名称:Simulator_GUI,代码行数:28,代码来源:SimulatorExperimence.py

示例2: doT1pT2p

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
 def doT1pT2p(self):
     print Community_Coordinate
     nPnt=1000
     nLink=40
     nT1=40
     nT2=20
     tests=""
     s=Simulator(nPnt)
     s.genPoints()
     s.genRandomLinks(nLink*nPnt) 
     
     f2 = open('doT1pT2p2.txt', 'w')               
     for i in range(0,101):     
         for j in range(0,i+1):   
             nSteps=self.MutiTimesNoGen(s,1,nT1,nT2,0.01*i,0.01*j)
             print str(i)+"\t"+ str(j) +"\t"+str(nSteps)
             f2.write(str(i)+"\t"+ str(j) +"\t"+str(nSteps)+"\n")
             tests=tests+str(nSteps)+"\t"
         for j in range(i,101):  
             tests=tests+"0\t"
         tests=tests+("\n")    
     f = open('doT1pT2p.txt', 'w')
     f.write(tests)
               
     return       
开发者ID:sagarjhaa,项目名称:Simulator_GUI,代码行数:27,代码来源:SimulatorExperimence.py

示例3: doT2P

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
 def doT2P(self):
     tests=[]
     s=Simulator(1000,40)
     s.genPoints()
     s.genLinks()
     for i in range(10,51):        
         nSteps=self.MutiTimesNoGen(s,1,20,0.5,0.01*i)
         print str(i*0.01) +"\t"+str(nSteps)
         tests.append(nSteps)
     print tests               
     return         
开发者ID:sagarjhaa,项目名称:Simulator,代码行数:13,代码来源:SimulatorExperimence.py

示例4: doT2Number

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
 def doT2Number(self):            
     tests=[]
     s=Simulator(1000,40,1)
     s.genPoints()
     s.genRandomLinks(40)
     for i in range(10,31):        
         nSteps=self.MutiTimesNoGen(s,2,30,i,0.5,0.2)
         print str(i) +"\t"+str(nSteps)
         tests.append(nSteps)
     print tests               
     return 
开发者ID:sagarjhaa,项目名称:Simulator,代码行数:13,代码来源:SimulatorExperimence.py

示例5: doT1P

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
 def doT1P(self):
     tests=[]
     s=Simulator(1000)
     s.genPoints()
     #s.genLinks(10*1000)
     s.genRandomLinks(10*1000)
     #s.setPointType(nOrigins, nLink1, nLink2, p1, p2)
     for i in range(20,101):        
         nSteps=self.MutiTimesNoGen(s,1,30,10,0.01*i,0.2)
         print str(i*0.01) +"\t"+str(nSteps)
         tests.append(nSteps)
     print tests               
     return 
开发者ID:sagarjhaa,项目名称:Simulator,代码行数:15,代码来源:SimulatorExperimence.py

示例6: testSimulator

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
    def testSimulator(self):
        s=Simulator(10000,5,2,1000,2000)
        s.genPoints()
        s.genLinks()

        #plt.subplot(121)
        fig, axes = plt.subplots(1, 2, figsize=(12,3))
        axes[0].scatter(s.getX1(1200),s.getY1(1200),s = 10, color='red',alpha=0.5)
        axes[0].set_title("scatter")

        
#         plt.plot(s.getX1(1200),s.getY1(1200),color='red', marker='o', markersize=20)
#         plt.plot(s.getX2(1200),s.getY2(1200),'-',color='blue')
#         plt.title('plot of y=x^2')
        
#         for p in s.pAll:
#             p       
        s.goSimulate("a")
     
        s.printSummary()
        
        x2s=s.getX2(1200)
        y2s=s.getY2(1200)
        
        print(len(x2s))
        print(len(y2s))
        
        axes[1].scatter(x2s,y2s)
        
        axes[1].set_title("simulated")

        
#         plt.subplot(122)
#         plt.plot(s.getX1(1200),s.getY1(1200),'-',color='red')
#         plt.plot(s.getX2(1200),s.getY2(1200),'-',color='blue')
#         plt.title('plot of y=x^2')
        plt.savefig("beauty.png")      
        plt.show()  

        pass
开发者ID:sagarjhaa,项目名称:Simulator,代码行数:42,代码来源:SimulatorTest.py

示例7: doT1nT2n

# 需要导入模块: from Simulator import Simulator [as 别名]
# 或者: from Simulator.Simulator import genPoints [as 别名]
 def doT1nT2n(self):
     nPnt=1000
     nLink=40
     
     tests=""
     s=Simulator(nPnt)
     s.genPoints()
     s.genRandomLinks(nLink*nPnt)    
     f2=    open('doT1nT2n2.txt', 'w')
     for i in range(0,100):     
         for j in range(0,i+1):   
             nSteps=self.MutiTimesNoGen(s,1,i,j,0.5,0.2)
             print str(i)+"\t"+ str(j) +"\t"+str(nSteps)
             f2.write(str(i)+"\t"+ str(j) +"\t"+str(nSteps)+"\n")
             tests=tests+str(nSteps)+"\t"
         for j in range(i,101):  
             tests=tests+"0\t"
         tests=tests+("\n")    
     f = open('doT1nT2n.txt', 'w')
     f.write(tests)
               
     return    
开发者ID:sagarjhaa,项目名称:Simulator,代码行数:24,代码来源:SimulatorExperimence.py


注:本文中的Simulator.Simulator.genPoints方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。