View Javadoc

1   package cz.cuni.amis.utils.floydwarshall;
2   
3   import cz.cuni.amis.utils.astar.AStarGoal;
4   
5   /**
6    * This interface provides additional information about the map Floyd-Warshall algorithm is going to work with.
7    * <p><p>
8    * Generally, you will use {@link FWMap} interface to define the map in general and then use this {@link FWMapView} interface
9    * to specify a specific needs you need to impose over the map as is "forbidding" some nodes or "imposing additional costs 
10   * onto the nodes".
11   *   
12   * @author Jimmy
13   */
14  public interface FWMapView<NODE> {
15  	
16  	/**
17  	 * Method defining extra-node cost, that is a cost that is attached to the "node", by having such node on the path costs 
18  	 * This allows you to provide "customization" to the graph nodes, basicly it is a way of telling "this node is cool to have in path" (negative cost)
19  	 * or "this node is bad to have in path" (positive cost).
20  	 * 
21  	 * @param nodeFrom
22  	 * @param nodeTo
23  	 * 
24  	 * @return
25  	 */
26  	public int getNodeExtraCost(NODE node);
27  	
28  	/**
29  	 * Method defining extra-edge cost, similar to {@link AStarGoal#getExtraCost(Object, Object)}. This allows you to
30  	 * provide "customization" to the graph edge lengths. It allows you to say "this is a cool edge to use for travel" (negative extra cost)
31  	 * or "this edge is hard to cross" (positive extra cost).
32  	 * 
33  	 * @param nodeFrom
34  	 * @param nodeTo
35  	 * 
36  	 * @return
37  	 */
38  	public int getEdgeExtraCost(NODE nodeFrom, NODE nodeTo);
39  
40  	/**
41  	 * Method defining which nodes are allowed to be explored / used by {@link FloydWarshall} for the purpose of path planning.
42  	 * May be used to define "forbidden" nodes, i.e., FloydWarshal will never return path leading to such nodes or using such nodes, it would
43  	 * act as edges into / from this node are non-existing.
44  	 * 
45  	 * @param node
46  	 * 
47  	 * @return
48  	 */
49  	public boolean isNodeOpened(NODE node);
50  	
51  	/**
52  	 * Method defining which "edges" (oriented links between nodes) can be used for the purpose of path-planning. It can be used
53  	 * to "forbid" usage of some edges, that is you can rule out some edges you do not want your agent to be able to travel.
54  	 * 
55  	 * @param nodeFrom
56  	 * @param nodeTo
57  	 * 
58  	 * @return
59  	 */
60  	public boolean isEdgeOpened(NODE nodeFrom, NODE nodeTo);
61  
62  }