View Javadoc

1   package cz.cuni.amis.pathfinding.map;
2   
3   import java.util.Collection;
4   
5   /**
6    * This interface provides additional information about the map algorithms are going to work with. In its implementation you may provide custom
7    * view on the map as needed for your search (for instance you need to forbid some nodes / edges or change the general cost of nodes / edges
8    * in order to change how your agent is going to plan the path).
9    * <p><p>
10   * Generally, you will use {@link IPFKnownMap} interface to define the map in general and then use this {@link IPFKnownMapView} interface
11   * to specify a specific needs you need to impose over the map as is "forbidding" some nodes or "imposing additional costs 
12   * onto the nodes".
13   * <p><p>
14   * See also {@link IPFMapView}
15   *   
16   * @author Jimmy
17   */
18  public interface IPFKnownMapView<NODE> extends IPFMapView<NODE> {
19  	
20  	/**
21  	 * This method may return new nodes which are not present in standard 'map' (as returned by {@link IPFKnownMap#getNodes()}).
22  	 * Such nodes are then exclusively accessible to your particular agent, that is, this methods is adding nodes that can be accessed 
23  	 * by the agent but are not part of your general map description.
24  	 * <p><p>
25  	 * Returned collection must not contain multiple references to a single node.
26  	 * <p><p>
27  	 * Returned collection must not contain any node from "mapNodes".
28  	 * 
29  	 * @param mapNodes "nodes" of map as returned by {@link IPFKnownMap#getNodes()}, may return null
30  	 */
31  	public Collection<NODE> getExtraNodes(Collection<NODE> mapNodes);
32  
33  	/**
34  	 * Default view does not impose any specific view on the map... all nodes/arcs are opened, no extra cost/nodes/arcs defined.
35  	 * @author Jimmy
36  	 */
37  	public class DefaultView<NODE> extends IPFMapView.DefaultView<NODE> implements IPFKnownMapView<NODE> {
38  
39  		@Override
40  		public Collection<NODE> getExtraNodes(Collection<NODE> mapNodes) {
41  			return null;
42  		}
43  
44  		
45  	}
46  	
47  }