|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgrapht.graph.AbstractGraph<V,E>
org.jgrapht.graph.AbstractBaseGraph<V,E>
org.jgrapht.graph.SimpleGraph<Node,org.jgrapht.graph.DefaultEdge>
Network
public class Network
Class representing an entire network.
Constructor Summary | |
---|---|
Network(int nnodes,
int nedges,
org.jgrapht.VertexFactory<Node> nodeFactory)
Constructor leading to a randomly generated topology. |
|
Network(java.lang.String graphFile,
org.jgrapht.VertexFactory<Node> nodeFactory)
Constructor that generates the Network using a description in a file. |
Method Summary | |
---|---|
boolean |
failNode(int n)
Mark a node as non-operational. |
static Network |
getNetwork()
There can be only one network in an application. |
Node[] |
getNodeArray()
|
boolean |
hasChanged()
Returns true if the network has changed (nodes added or deleted) since the last invocation of takeStep(), false otherwise. |
void |
initialize()
This method MUST BE invoked after construction to finalize creation of the Network object. |
int |
numEdges()
|
int |
numNodes()
|
void |
takeStep()
Take a time step. |
Methods inherited from class org.jgrapht.graph.AbstractBaseGraph |
---|
addEdge, addEdge, addVertex, clone, containsEdge, containsVertex, degreeOf, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, incomingEdgesOf, inDegreeOf, isAllowingLoops, isAllowingMultipleEdges, outDegreeOf, outgoingEdgesOf, removeEdge, removeEdge, removeVertex, setEdgeSetFactory, setEdgeWeight, vertexSet |
Methods inherited from class org.jgrapht.graph.AbstractGraph |
---|
assertVertexExist, containsEdge, removeAllEdges, removeAllEdges, removeAllEdges, removeAllVertices, toString, toStringFromSets |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jgrapht.UndirectedGraph |
---|
degreeOf |
Methods inherited from interface org.jgrapht.Graph |
---|
addEdge, addEdge, addVertex, containsEdge, containsEdge, containsVertex, edgeSet, edgesOf, getAllEdges, getEdge, getEdgeFactory, getEdgeSource, getEdgeTarget, getEdgeWeight, removeAllEdges, removeAllEdges, removeAllVertices, removeEdge, removeEdge, removeVertex, vertexSet |
Constructor Detail |
---|
public Network(int nnodes, int nedges, org.jgrapht.VertexFactory<Node> nodeFactory) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
There can be at most one Network object in the application. An IllegalStateException is thrown otherwise.
java.lang.IllegalArgumentException
java.lang.IllegalStateException
public Network(java.lang.String graphFile, org.jgrapht.VertexFactory<Node> nodeFactory) throws java.lang.IllegalStateException, java.io.FileNotFoundException, java.io.IOException
#nodes src dst src dst ...
First construct the network object, then call initialize().
There can be at most one Network object in the application. An IllegalStateException is thrown otherwise.
java.lang.IllegalStateException
java.io.FileNotFoundException
java.io.IOException
Method Detail |
---|
public static Network getNetwork()
public Node[] getNodeArray()
public int numNodes()
public int numEdges()
public boolean hasChanged()
public void initialize()
public boolean failNode(int n)
public void takeStep()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |