pongsim_topologygenerator
index
u:\f\project - pongsim\pongsim850\pongsim_topologygenerator.py

######################################################################
#####
#####    PONGsim (Python Overlay Network Graphical Simulator)
#####    Topology generator module
#####    Version: 1.00
#####
######################################################################
#####    
#####    PONGsim (Python Overlay Network Graphical Simulator)
#####    
#####    Copyright (c) 2005-2007 Nicklas Beijar
#####    
#####    Permission is hereby granted, free of charge, to any person
#####    obtaining a copy of this software and associated documentation
#####    files (the "Software"), to deal in the Software without
#####    restriction, including without limitation the rights to use,
#####    copy, modify, merge, publish, distribute, sublicense, and/or
#####    sell copies of the Software, and to permit persons to whom the
#####    Software is furnished to do so, subject to the following
#####    conditions:
#####    
#####    The above copyright notice and this permission notice shall be
#####    included in all copies or substantial portions of the Software.
#####    
#####    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
#####    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
#####    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
#####    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
#####    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
#####    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#####    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
#####    OTHER DEALINGS IN THE SOFTWARE.
#####
######################################################################
#####
#####    Nicklas Beijar, nbeijar@netlab.tkk.fi
#####    Networking Laboratory, Helsinki University of Technology
##### 
######################################################################
#####
#####    To do:
#####    - (nothing)
#####
######################################################################

 
Modules
       
random

 
Classes
       
Topology

 
class Topology
     Methods defined here:
__init__(self, nodes)
addedge(self, a, b, weight=1)
avgdegree(self)
degreedistribution(self)
fullyconnected(self)
hasedge(self, a, b)
isconnected(self)
list(self)
neighbors(self, a)
powerlaw_BA_based(self, minlinks)
powerlaw_BA_degree(self, mindegree)
powerlaw_BA_degree2(self, mindegree)
powerlaw_BA_orig(self, initialnodes, linksperstep)
powerlaw_BA_orig_degree(self, mindegree)
# only even parameters on mindegree
powerlaw_New_degree(self, mindegree)
powerlaw_PLOD(self, alpha, beta)
# Problems:
# - not always connected
# - does not always generate an even M -> does not stop
# - risk that the last possible link is impossible because of existing link -> does not stop

 
Functions
       
test1()
test2()
test3()