edu.stanford.multiagent.gamer.graphs
Class PLODGraph

java.lang.Object
  |
  +--edu.stanford.multiagent.gamer.ParameterizedObject
        |
        +--edu.stanford.multiagent.gamer.graphs.Graph
              |
              +--edu.stanford.multiagent.gamer.graphs.ALGraph
                    |
                    +--edu.stanford.multiagent.gamer.graphs.PLODGraph

public class PLODGraph
extends ALGraph

Generetes a power-law out-degree graph using PLOD algorithm by Palmer and Steffan (Generating Network Topologies That Obey Power Laws). If symmetric flag is set to false, generates undirected version of this.


Field Summary
 
Fields inherited from class edu.stanford.multiagent.gamer.graphs.ALGraph
nodes
 
Fields inherited from class edu.stanford.multiagent.gamer.graphs.Graph
nEdges, nNodes, nodeData, pReflexEdges, pSymEdges
 
Fields inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
parameters
 
Constructor Summary
PLODGraph()
           
 
Method Summary
protected  void checkParameters()
          Makes sure that the parameters are in the proper range.
 void doGenerate()
          Generates a random graph with given parameters.
protected  java.lang.String getGraphHelp()
          Returns a help information string about the particular graph, does not include parameter information.
 boolean hasSymEdges()
          Returns true if it must be the case that for every edge a to b there is also an edge b to a.
 void initialize()
          Calls graph initialize and also sets up the nodes Vector.
 void randomizeParameters()
          Resets the range of the number of nodes and randomizes.
 boolean reflexEdgesOk()
          Returns true if reflexive edges are allowed.
 
Methods inherited from class edu.stanford.multiagent.gamer.graphs.ALGraph
addEdge, addEdge, addNode, areNeighbours, getEdge, getEdges, getNeighbours, getNumNeighbours, removeEdge, removeEdge, setEdgeData
 
Methods inherited from class edu.stanford.multiagent.gamer.graphs.Graph
getHelp, getNEdges, getNNodes, getNodeData, setNodeData
 
Methods inherited from class edu.stanford.multiagent.gamer.ParameterizedObject
getBooleanParameter, getDescription, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, setParameter, setParameter, setParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PLODGraph

public PLODGraph()
          throws java.lang.Exception
Method Detail

getGraphHelp

protected java.lang.String getGraphHelp()
Description copied from class: Graph
Returns a help information string about the particular graph, does not include parameter information.

Specified by:
getGraphHelp in class Graph

initialize

public void initialize()
                throws java.lang.Exception
Calls graph initialize and also sets up the nodes Vector.

Overrides:
initialize in class Graph
Throws:
java.lang.Exception

randomizeParameters

public void randomizeParameters()
Resets the range of the number of nodes and randomizes.

Overrides:
randomizeParameters in class ParameterizedObject

checkParameters

protected void checkParameters()
                        throws java.lang.Exception
Makes sure that the parameters are in the proper range.

Overrides:
checkParameters in class ALGraph
Throws:
java.lang.Exception - if anything is wrong with the parameter values

hasSymEdges

public boolean hasSymEdges()
Returns true if it must be the case that for every edge a to b there is also an edge b to a.

Specified by:
hasSymEdges in class Graph

reflexEdgesOk

public boolean reflexEdgesOk()
Returns true if reflexive edges are allowed.

Specified by:
reflexEdgesOk in class Graph

doGenerate

public void doGenerate()
Generates a random graph with given parameters.

Specified by:
doGenerate in class ParameterizedObject