edu.iu.iv.modeling.p2p.pru
Class PruAlgorithm

java.lang.Object
  |
  +--edu.iu.iv.modeling.p2p.pru.PruAlgorithm
All Implemented Interfaces:
Algorithm

public class PruAlgorithm
extends java.lang.Object
implements Algorithm

Wrapper for PRU Network Modeling Algorithm

Author:
Hardik Sheth (hsheth@indiana.edu)

Constructor Summary
PruAlgorithm(int networkSize, int cacheSize, int lowerBound, int upperBound)
          Constructor for PruAlgorithm class.
 
Method Summary
 boolean execute()
          Runs the algorithm.
 int getCacheSize()
          Returns the number of nodes in the cache
 java.lang.String getFileName()
          This method gets the name of the file that stores the network graph
 int getLowerBound()
          Returns the minimum degree of nodes in the network
 int getNetworkSize()
          This method gets the size of the network
 int getUpperBound()
          Returns the maximum degree of nodes in the network
 void setCacheSize(int cacheSize)
          Sets the cache size
 void setFileName(java.lang.String filename)
          This method sets the name of the file which'll store the network graph
 void setLowerBound(int minDegree)
          Sets the minimum degree of nodes
 void setNetworkSize(int networkSize)
          This method sets the size of the network to be built
 void setUpperBound(int maxDegree)
          Sets the max degree of nodes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PruAlgorithm

public PruAlgorithm(int networkSize,
                    int cacheSize,
                    int lowerBound,
                    int upperBound)
Constructor for PruAlgorithm class. It sets the network size and the minimum degree of the node

Parameters:
networkSize - - size of the network
cacheSize - - number of nodes in the cache
lowerBound - - minimum degree of nodes in the network
upperBound - - maximum degree of nodes in the network
Method Detail

execute

public boolean execute()
Description copied from interface: Algorithm
Runs the algorithm.

Specified by:
execute in interface Algorithm
Returns:
true if the algorithm ran successfully, false otherwise.
See Also:
Algorithm.execute()

setNetworkSize

public void setNetworkSize(int networkSize)
This method sets the size of the network to be built

Parameters:
networkSize -

getNetworkSize

public int getNetworkSize()
This method gets the size of the network

Returns:
network size

getFileName

public java.lang.String getFileName()
This method gets the name of the file that stores the network graph

Returns:
String

setFileName

public void setFileName(java.lang.String filename)
This method sets the name of the file which'll store the network graph

Parameters:
filename -

getCacheSize

public int getCacheSize()
Returns the number of nodes in the cache

Returns:
cache size

getLowerBound

public int getLowerBound()
Returns the minimum degree of nodes in the network

Returns:
minDegree

getUpperBound

public int getUpperBound()
Returns the maximum degree of nodes in the network

Returns:
maxDegree

setCacheSize

public void setCacheSize(int cacheSize)
Sets the cache size

Parameters:
cacheSize -

setLowerBound

public void setLowerBound(int minDegree)
Sets the minimum degree of nodes

Parameters:
minDegree -

setUpperBound

public void setUpperBound(int maxDegree)
Sets the max degree of nodes

Parameters:
maxDegree -