1 package cz.cuni.amis.utils.floydwarshall;
2
3 import java.util.Collection;
4 import java.util.List;
5
6 /**
7 * This class represents the search space for Floyd-Warshall algorithm.
8 * <ol>
9 * <li>we need to know which nodes are part of the map</li>
10 * <li>we need to know the travel cost between two nodes (edge cost)</li>
11 * </ol>
12 */
13 public interface FWMap<NODE> {
14
15 /**
16 * This must return the list of ALL NODES that are present in your map (== environment).
17 * These nodes are going to be then used for FW.
18 * <p><p>
19 * IT IS FORBIDDEN TO SHUFFLE NODES IN THIS LIST ... IT MUST ALWAYS RETURN THE VERY SAME LIST (or at least
20 * list that is having every node in the place it was before).
21 */
22 public List<NODE> getNodes();
23
24 /**
25 * General cost of having this node at your path. This allows you to say how every node appeals to the agent,
26 * it may specify "this is a cool node, try to get it on your path" (negative cost) or "this is neutral node"
27 * (zero cost) or "this is a bad node to have on your path" (positive cost).
28 *
29 * @param node
30 * @return
31 */
32 public int getNodeCost(NODE node);
33
34 /**
35 * Should return the distance from nodeFrom to nodeTo.
36 * You can be sure that nodeTo is among the neighbours of nodeFrom.
37 *
38 * @param nodeFrom
39 * @param nodeTo
40 * @return cost of an edge
41 */
42 public int getEdgeCost(NODE nodeFrom, NODE nodeTo);
43
44
45 }