edu.iu.iv.modeling.p2p.hypergrid
Class HypergridNetwork

java.lang.Object
  |
  +--edu.iu.iv.modeling.p2p.hypergrid.HypergridNetwork

public class HypergridNetwork
extends java.lang.Object

HyperGrid Network Model for Unstructured P2P Networks

Author:
Hardik Sheth (hsheth@indiana.edu)

Constructor Summary
HypergridNetwork(int networkSize, int degree)
          Constructor for HypergridNetwork.
 
Method Summary
 boolean buildHyperGridNetwork()
          This method builds the unstructured P2P network based on Hypergrid topology
 float getAvgDegree()
          Get average degree of the network
 java.lang.String getFailReason()
          Get the reason because of which modelig failed
 edu.uci.ics.jung.graph.Graph getGraph()
          This method returns the Graph object built on HyperGrid network
 int getMaxDegree()
          Get max degree of the network
 int getMinDegree()
          Get min degree of the network
 void printNetwork()
          Print graph
 void writeGraph(java.lang.String filename)
          Write the graph to a file
 void writePajekFile(java.lang.String filename)
          Create a Pajek file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HypergridNetwork

public HypergridNetwork(int networkSize,
                        int degree)
Constructor for HypergridNetwork. Initializes an UndirectedSparseGraph and sets the network size

Parameters:
networkSize -
Method Detail

getGraph

public edu.uci.ics.jung.graph.Graph getGraph()
This method returns the Graph object built on HyperGrid network

Returns:
graph

buildHyperGridNetwork

public boolean buildHyperGridNetwork()
This method builds the unstructured P2P network based on Hypergrid topology

Returns:
true if the network built, false otherwise

printNetwork

public void printNetwork()
Print graph


writePajekFile

public void writePajekFile(java.lang.String filename)
Create a Pajek file


writeGraph

public void writeGraph(java.lang.String filename)
Write the graph to a file


getAvgDegree

public float getAvgDegree()
Get average degree of the network

Returns:
average degree

getMaxDegree

public int getMaxDegree()
Get max degree of the network

Returns:
max degree

getMinDegree

public int getMinDegree()
Get min degree of the network

Returns:
min degree

getFailReason

public java.lang.String getFailReason()
Get the reason because of which modelig failed

Returns:
reason