|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.framework.Graph<V>
public class Graph<V extends Info>
This class represents the problem construction graph. Note that this implementation is not synchronized.
Nested Class Summary | |
---|---|
static class |
Graph.EdgeEvaporateTransform
This class represents the probabilistic evaporation transform. |
static class |
Graph.EdgeInitializationTransform
This class represents an initialization transform. |
static class |
Graph.EdgeRangeTransform
This class represents the range-fixed pheromone transform. |
static class |
Graph.Element
This class represents an element of the graph. |
Field Summary | |
---|---|
static net.sf.myra.framework.Graph.Transform |
EDGE_EVAPORATION
The edge pheromone normalization transformation. |
static net.sf.myra.framework.Graph.Transform |
EDGE_INITIALIZATION
The edge pheromone initialisation transformation. |
Constructor Summary | |
---|---|
Graph()
Default constructor. |
|
Graph(int capacity)
Creates a new Graph instance with the specified initial
capacity. |
Method Summary | |
---|---|
void |
add(Vertex<V> vertex)
Adds a new node to the graph. |
void |
apply(net.sf.myra.framework.Graph.Transform transform)
Applies the specified tranformation in this graph. |
void |
connect()
Fully connects all nodes of the graph. |
void |
connect(Vertex<V> from,
Vertex<V> to)
Creates an edge (link) between the specified nodes. |
Vertex<V> |
get(java.lang.String label)
Returns the specified vertex given its label. |
Edge<V> |
getEdge(Vertex<V> from,
Vertex<V> to)
Returns the edge between the specified vertices. |
java.util.Collection<Edge<V>> |
getEdges(Vertex<V> vertex)
Returns the list of edges of the specified vertex. |
java.util.Collection<Vertex<V>> |
getNeighbours(Vertex<V> vertex)
Returns the list of neighbors of the specified node. |
java.util.Collection<Vertex<V>> |
getVertices()
Returns the set of vertices of this graph. |
void |
merge(Graph<V> other)
Merges the specified graph with this graph, by adding an edge from every vertex on this graph to every vertex of the specified graph. |
java.lang.String |
toString()
|
Vertex<V>[] |
vertices()
Returns the array of vertices. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final net.sf.myra.framework.Graph.Transform EDGE_EVAPORATION
public static final net.sf.myra.framework.Graph.Transform EDGE_INITIALIZATION
Constructor Detail |
---|
public Graph()
public Graph(int capacity)
Graph
instance with the specified initial
capacity.
capacity
- the initial capacity.Method Detail |
---|
public void add(Vertex<V> vertex)
vertex
- the node to add.public void apply(net.sf.myra.framework.Graph.Transform transform)
transform
- the transformation to be applied.public void connect(Vertex<V> from, Vertex<V> to)
from
- the start node.to
- the end node.public void connect()
public void merge(Graph<V> other)
other
- the graph to be merged.public java.util.Collection<Vertex<V>> getNeighbours(Vertex<V> vertex)
vertex
- the node in the graph.
public java.util.Collection<Edge<V>> getEdges(Vertex<V> vertex)
vertex
- the node in the graph.
public Edge<V> getEdge(Vertex<V> from, Vertex<V> to)
from
- the "from" end of the edge.to
- the "to" end of the edge.
public Vertex<V> get(java.lang.String label)
label
- the label of the vertex.
public java.util.Collection<Vertex<V>> getVertices()
public Vertex<V>[] vertices()
null
position if the initial capacity is greater than
the number of vertices.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |