01 package dk.deepthought.sidious.planner.graph;
02
03 import java.util.Collection;
04
05 import dk.deepthought.sidious.supportsystem.SuperLinkID;
06
07 /**
08 * This is the general interface for a graph used for pathfinding.
09 *
10 * @author Deepthought
11 *
12 */
13 public interface Graph {
14
15 /**
16 * Gets the edges with the specified <code>Vertex</code> as starting
17 * point.
18 *
19 * @param v
20 * the starting <code>Vertex</code>
21 * @return all edges starting in the specified <code>Vertex</code>
22 */
23 public Collection<Edge> getEdges(Vertex v);
24
25 /**
26 * Gets the source <code>Vertex</code> of this <code>Graph</code>. The
27 * source vertex is defined as the starting point of any path in this graph.
28 * <p>
29 * The implementing graph class <i>must</i> guarantee that any
30 * preconditions for the source vertex of the <code>Pathfinder</code> are
31 * not violated.
32 *
33 * @return the source vertex of this graph
34 */
35 public Vertex getSourceVertex();
36
37 /**
38 * Gets the goal <code>Vertex</code> of this <code>Graph</code>. The
39 * goal vertex is defined as the ending point of any path in this graph.
40 * <p>
41 * The implementing graph class <i>must</i> guarantee that any
42 * preconditions for the goal vertex of the <code>Pathfinder</code> are
43 * not violated.
44 *
45 * @return the goal vertex of this graph
46 */
47 public Vertex getGoalVertex();
48
49 /**
50 * Method sets the goalVertex to this vertex if all the goal state
51 * descriptors are contained in the input vertex.
52 *
53 * @param v
54 * the approximate goal candidate
55 * @throws IllegalArgumentException
56 * thrown if the input vertex is not a valid approximate goal
57 */
58 public void setApproximateGoal(Vertex v);
59
60 /**
61 * Returns the id of the owner/requester for this graph.
62 *
63 * @return the id of the requester
64 */
65 public SuperLinkID getId();
66
67 }
|