|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object CommGraph
public class CommGraph
Stores the topology of an instantaneous communication graph, as well as the message queues between each pair of robots connected in the graph. Can be used to hold directed and undirected edges. Edge addition functions copy message queues from prior graph, if one is provided.
Graph representation is in the form of two adjacency lists (see http://www.nist.gov/dads/HTML/adjacencyListRep.html for documentation on adjacency lists) (also see Cormen, Leierson, Rivest, Stein Chapter 22) One adjacency list is for quick lookup for all edges incoming to a particular node, the other is for all edges outgoing to a particular node. The two structures edge share representation memory for each shared edge.
Constructor Summary | |
---|---|
CommGraph()
|
|
CommGraph(CommGraph src)
Copy constructor -- performs deep copy of graph |
|
CommGraph(int nNumNodes)
Creates an empty graph (no edges) on nNumNodes nodes |
Method Summary | |
---|---|
CommLink |
addLink(int iSrc,
int iDst,
CommGraph gCopyLinksFrom)
Adds a new link (directed edge) to a graph. |
CommLink |
addLink(int iSrc,
int iDst,
CommLink.IChannelData channelData,
CommGraph gCopyLinksFrom)
Adds a new link (directed edge) to a graph. |
IMsgChannel |
getChannelType()
|
java.util.Iterator<CommLink> |
getEdgesFrom(int nNodeFrom)
|
java.util.Iterator<CommLink> |
getEdgesTo(int nNodeTo)
|
int |
getSize()
|
void |
insertExistLink(CommLink link)
Insert an exsting CommLink into this graph. |
void |
setChannelType(IMsgChannel channelToClone)
Changes the default channel type for new links new channels are all of the same type as channelToClone |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommGraph()
public CommGraph(int nNumNodes)
public CommGraph(CommGraph src)
Method Detail |
---|
public void setChannelType(IMsgChannel channelToClone)
public IMsgChannel getChannelType()
public java.util.Iterator<CommLink> getEdgesFrom(int nNodeFrom)
nNodeFrom
- node to get outgoing edges of
public java.util.Iterator<CommLink> getEdgesTo(int nNodeTo)
nNodeTo
- node to get incoming edges of
public void insertExistLink(CommLink link)
link
- link to insertpublic CommLink addLink(int iSrc, int iDst, CommGraph gCopyLinksFrom)
iSrc
- source index of link to addiDst
- destination index of link to addgCopyLinksFrom
- previous graph (to copy communication channels from if available) Can be null.
public CommLink addLink(int iSrc, int iDst, CommLink.IChannelData channelData, CommGraph gCopyLinksFrom)
iSrc
- source index of link to addiDst
- destination index of link to addchannelData
- associated channel datagCopyLinksFrom
- previous graph (to copy communication channels from if available) Can be null.
public int getSize()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |