Class ContextJungNetwork<T>
java.lang.Object
repast.simphony.context.space.graph.ContextJungNetwork<T>
- All Implemented Interfaces:
- ContextListener<T>,- Network<T>,- Projection<T>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddAll()addEdge(RepastEdge<T> edge) Adds the specified edge to this Network.Adds an edge between the specified objects.Adds an edge between the specified objects.voidaddProjectionListener(ProjectionListener listener) Adds listener for this projection.voidbooleancontainsEdge(RepastEdge<T> edge) Returns whether or not this network contains the specified edge.booleanbooleanevaluate(ProjectionPredicate predicate) Evaluate this Projection against the specified Predicate.voideventOccured(ContextEvent<T> ev) Called to nofify the listener of a change to a context.getAdjacent(T agent) Gets any objects that are adjacent to this object.intGet the total degree (number of edges) for the graph.intGets the degree of the node associated with the specified object.Retrieves the edge between the specified source and target.EdgeCreator<? extends RepastEdge<T>,T> Gets the EdgeCreator used to create edges for this Network.getEdges()Gets all the edges in this Network.Gets all the edges where the specified object is a source or a target.edu.uci.ics.jung.graph.Graph<T,RepastEdge<T>> getGraph()intgetInDegree(T agent) Gets the in degree of the node associated with the specified object.getInEdges(T agent) Gets all the in-edges for the specified object.getName()getNodes()Gets an iterator over all the agent nodes in this network.intgetOutDegree(T agent) Gets the out degree of the node associated with the specified object.getOutEdges(T agent) Gets all the out-edges for the specified object.getPredecessors(T agent) Gets the predecessors of the specified object.Gets all the listeners for this projection.getRandomAdjacent(T agent) Gets a random object that is adjacent to the specified object.getRandomPredecessor(T agent) Get a random predecessor of the specified object.getRandomSuccessor(T agent) Gets a random successor of the specified object.getSuccessors(T agent) Gets the successors of the specified object.inthashCode()booleanisAdjacent(T first, T second) Returns true if the first object is adjacent to the second.booleanbooleanisPredecessor(T first, T second) Returns true if the first object is a predecessor of the second.booleanisSuccessor(T first, T second) Returns true if the first object is a successor of the second.intnumEdges()Gets the number of edges in this Network.protected voidvoidremoveEdge(RepastEdge<T> edge) Removes the specified edge from this Network.voidMethod removes all edges in the given network.booleanremoveProjectionListener(ProjectionListener listener) Removes a listener from the this projection.voidremoveVertex(T vertex) voidsetGraph(edu.uci.ics.jung.graph.Graph<T, RepastEdge<T>> graph) intsize()Gets the number of nodes in this network.toString()
- 
Constructor Details- 
ContextJungNetwork
 
- 
- 
Method Details- 
eventOccuredDescription copied from interface:ContextListenerCalled to nofify the listener of a change to a context.- Specified by:
- eventOccuredin interface- ContextListener<T>
- Parameters:
- ev- The event of which to notify the listener.
 
- 
addAllprotected void addAll()
- 
removeAllprotected void removeAll()
- 
getEdgeCreatorGets the EdgeCreator used to create edges for this Network.addEdgeandaddEdgewill use this creator to create edges. Any edge added withaddEdgemust be of the same type as that created with this EdgeCreator. By default, an edge creator that creates RepastEdges is used. The default EdgeCreator will create RepastEdge- Specified by:
- getEdgeCreatorin interface- Network<T>
- Returns:
- the edge class of this network
 
- 
addEdgeDescription copied from interface:NetworkAdds the specified edge to this Network. This will change the directionality of the edge to met that of the network.
- 
addEdgeDescription copied from interface:NetworkAdds an edge between the specified objects.
- 
addEdgeDescription copied from interface:NetworkAdds an edge between the specified objects.
- 
addProjectionListenerDescription copied from interface:ProjectionAdds listener for this projection.- Specified by:
- addProjectionListenerin interface- Projection<T>
- Parameters:
- listener- the listener to add.
 
- 
addVertex
- 
equals
- 
evaluateDescription copied from interface:ProjectionEvaluate this Projection against the specified Predicate. This typically involves a double dispatch where the Projection calls back to the predicate, passing itself.- Specified by:
- evaluatein interface- Projection<T>
- Returns:
- true if the predicate evaluates to true, otherwise false. False can also mean that the predicate is not applicable to this Projection. For example, a linked type predicate evaluated against a grid projection.
 
- 
getAdjacentDescription copied from interface:NetworkGets any objects that are adjacent to this object. An object is adjacent if it has an edge either from or to the specified object.- Specified by:
- getAdjacentin interface- Network<T>
- Parameters:
- agent- the object whose adjacent objects should be returned
- Returns:
- an iterator over all the objects adjacent to the specified object.
 
- 
getDegreepublic int getDegree()Description copied from interface:NetworkGet the total degree (number of edges) for the graph.
- 
getDegreeDescription copied from interface:NetworkGets the degree of the node associated with the specified object.
- 
getEdgeDescription copied from interface:NetworkRetrieves the edge between the specified source and target. If multiple edges exist between these two objects, the first found will be returned.
- 
getEdgesDescription copied from interface:NetworkGets all the edges in this Network.
- 
getEdgesDescription copied from interface:NetworkGets all the edges where the specified object is a source or a target.
- 
getGraph
- 
getInDegreeDescription copied from interface:NetworkGets the in degree of the node associated with the specified object.- Specified by:
- getInDegreein interface- Network<T>
- Parameters:
- agent- the object whose node's in degree we want.
- Returns:
- the in degree of the node associated with the specified object.
 
- 
getInEdgesDescription copied from interface:NetworkGets all the in-edges for the specified object. In a directed network an in edge is any edge where the specified object is the target. In an undirected network, edges are both in- and out-, and so all edges are returned.- Specified by:
- getInEdgesin interface- Network<T>
- Parameters:
- agent- the object whose in-edges should be returned
- Returns:
- an iterator over all the in-edges for the specified object.
 
- 
getName- Specified by:
- getNamein interface- Projection<T>
 
- 
getNodesDescription copied from interface:NetworkGets an iterator over all the agent nodes in this network.
- 
getOutDegreeDescription copied from interface:NetworkGets the out degree of the node associated with the specified object.- Specified by:
- getOutDegreein interface- Network<T>
- Parameters:
- agent- the object whose node's out degree we want.
- Returns:
- the out degree of the node associated with the specified object.
 
- 
getOutEdgesDescription copied from interface:NetworkGets all the out-edges for the specified object. In a directed network an out edge is any edge where the specified object is the source. In an undirected network, edges are both in- and out-, and so all edges are returned.- Specified by:
- getOutEdgesin interface- Network<T>
- Parameters:
- agent- the object whose out-edges should be returned
- Returns:
- an iterator over all the out-edges for the specified object.
 
- 
getPredecessorsDescription copied from interface:NetworkGets the predecessors of the specified object. If the network is directed then the predecessors are any objects connected to the specified object by an edge where the specified object is the target of that edge. If the network is undirected, then this returns any object connected to the specified object.- Specified by:
- getPredecessorsin interface- Network<T>
- Parameters:
- agent- the object whose predecessors should be returned
- Returns:
- an iterator over the predecessors of the specified object.
 
- 
getProjectionListenersDescription copied from interface:ProjectionGets all the listeners for this projection.- Specified by:
- getProjectionListenersin interface- Projection<T>
- Returns:
- an iterable over all the listeners for this projection.
 
- 
getRandomAdjacentDescription copied from interface:NetworkGets a random object that is adjacent to the specified object.- Specified by:
- getRandomAdjacentin interface- Network<T>
- Returns:
- a random object that is adjacent to the specified object or null if no objects are adjacent.
 
- 
getRandomPredecessorDescription copied from interface:NetworkGet a random predecessor of the specified object. If the network is directed then the predecessors are any objects connected to the specified object by an edge where the specified object is the target of that edge. If the network is undirected, then a predecessor can be any object connected to the specified object.- Specified by:
- getRandomPredecessorin interface- Network<T>
- Returns:
- a random predecessor of the specified object or null if there are no predecessors.
 
- 
getRandomSuccessorDescription copied from interface:NetworkGets a random successor of the specified object. If the network is directed then the successors are any objects connected to the specified object by an edge where the specified object is the source of that edge. If the network is undirected, then a successor can be any object connected to the specified object.- Specified by:
- getRandomSuccessorin interface- Network<T>
- Returns:
- a random predecessor of the specified object or null if there are no successors.
 
- 
getSuccessorsDescription copied from interface:NetworkGets the successors of the specified object. If the network is directed then the successors are any objects connected to the specified object by an edge where the specified object is the source of that edge. If the network is undirected, then this returns any object connected to the specified object.- Specified by:
- getSuccessorsin interface- Network<T>
- Parameters:
- agent- the object whose successors should be returned
- Returns:
- an iterator over the successors of the specified object.
 
- 
hashCodepublic int hashCode()
- 
isAdjacentDescription copied from interface:NetworkReturns true if the first object is adjacent to the second. An object is adjacent to another if there is an edge between the first object and the second, regardeless of the edges directionality.- Specified by:
- isAdjacentin interface- Network<T>
- Returns:
- true if the first object is a adjacent to the second.
 
- 
isDirectedpublic boolean isDirected()- Specified by:
- isDirectedin interface- Network<T>
- Returns:
- true if this Network is directed, otherwise false.
 
- 
isPredecessorDescription copied from interface:NetworkReturns true if the first object is a predecessor of the second. If the network is directed then the predecessors are any objects connected to the specified object by an edge where the specified object is the target of that edge. If the network is undirected, then a predecessor can be any object connected to the specified object.- Specified by:
- isPredecessorin interface- Network<T>
- Returns:
- true if the first object is a predecessor of the second.
 
- 
isSuccessorDescription copied from interface:NetworkReturns true if the first object is a successor of the second. If the network is directed then the successors are any objects connected to the specified object by an edge where the specified object is the source of that edge. If the network is undirected, then a successor can be any object connected to the specified object.- Specified by:
- isSuccessorin interface- Network<T>
- Returns:
- true if the first object is a successor of the second.
 
- 
numEdgespublic int numEdges()Description copied from interface:NetworkGets the number of edges in this Network.
- 
removeEdgeDescription copied from interface:NetworkRemoves the specified edge from this Network.- Specified by:
- removeEdgein interface- Network<T>
- Parameters:
- edge- the edge to remove
 
- 
containsEdgeReturns whether or not this network contains the specified edge.- Specified by:
- containsEdgein interface- Network<T>
- Parameters:
- edge- the edge to check
- Returns:
- true if the network contains the specified edge, otherwise false.
 
- 
removeProjectionListenerDescription copied from interface:ProjectionRemoves a listener from the this projection.- Specified by:
- removeProjectionListenerin interface- Projection<T>
- Parameters:
- listener- the listener to remove
- Returns:
- true if the listener was succesfully removed, otherwise false
 
- 
removeVertex
- 
setGraph
- 
sizepublic int size()Description copied from interface:NetworkGets the number of nodes in this network.
- 
toString
- 
removeEdgespublic void removeEdges()Description copied from interface:NetworkMethod removes all edges in the given network.- Specified by:
- removeEdgesin interface- Network<T>
 
 
-