|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.multiagent.gamer.ParameterizedObject | +--edu.stanford.multiagent.gamer.graphs.Graph | +--edu.stanford.multiagent.gamer.graphs.AMGraph
An Adjacency matrix implementation of the Graph interface Not fully implemented.
Field Summary |
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 | |
AMGraph()
Constructor |
|
AMGraph(int nNodes)
Constructor, initializes the number of nodes |
Method Summary | |
void |
addEdge(int s,
int t)
Adds an edge. |
void |
addEdge(int s,
int t,
java.lang.Object data)
Add an edge with data Currently not implemented, does the same thing as the other version of addEdge. |
void |
addNode()
Adds a node. |
boolean |
areNeighbours(int from,
int to)
Checks if two nodes are neighbours. |
edu.stanford.multiagent.gamer.graphs.Edge |
getEdge(int s,
int t)
Gets an Edge |
java.util.Iterator |
getEdges(int from)
Return an iterator over the outgoing edges |
java.util.Iterator |
getNeighbours(int from)
Returns an iterator over the node's neighbours |
void |
removeEdge(edu.stanford.multiagent.gamer.graphs.Edge e)
Removes an edge from the graph. |
void |
removeEdge(int s,
int t)
Removes an edge |
void |
setEdgeData(int s,
int t,
java.lang.Object data)
Sets the data item for the edge between s and t if this edge already exists |
Methods inherited from class edu.stanford.multiagent.gamer.graphs.Graph |
getGraphHelp, getHelp, getNEdges, getNNodes, getNodeData, hasSymEdges, initialize, reflexEdgesOk, setNodeData |
Methods inherited from class edu.stanford.multiagent.gamer.ParameterizedObject |
checkParameters, doGenerate, getBooleanParameter, getDescription, getDoubleParameter, getLongParameter, getParamDescription, getParameter, getParameters, getStringParameter, randomizeParameters, setParameter, setParameter, setParameters, setParameters |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AMGraph() throws java.lang.Exception
public AMGraph(int nNodes) throws java.lang.Exception
Method Detail |
public void addNode()
addNode
in class Graph
public void addEdge(int s, int t)
addEdge
in class Graph
s
- index of first nodet
- index of second nodepublic void addEdge(int s, int t, java.lang.Object data)
addEdge
in class Graph
s
- index of first nodet
- index of second nodedata
- data to be stored on this edgepublic void setEdgeData(int s, int t, java.lang.Object data)
setEdgeData
in class Graph
s
- index of the first node on the edget
- index of the second node on the egdedata
- data to be stored on the edgepublic void removeEdge(int s, int t)
removeEdge
in class Graph
s
- index of the first node on the edget
- index of the second node on the edgepublic void removeEdge(edu.stanford.multiagent.gamer.graphs.Edge e)
Graph
removeEdge
in class Graph
e
- the edge to be removedpublic edu.stanford.multiagent.gamer.graphs.Edge getEdge(int s, int t)
getEdge
in class Graph
s
- index of the first node on the edget
- index of the second node on the edgepublic boolean areNeighbours(int from, int to)
areNeighbours
in class Graph
from
- index of the node at which the edge beginsto
- index of the node at which the egde endspublic java.util.Iterator getNeighbours(int from)
getNeighbours
in class Graph
from
- index of the nodepublic java.util.Iterator getEdges(int from)
getEdges
in class Graph
from
- index of the node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |