001    package aima.search.map;
002    
003    import java.util.List;
004    /**
005     * Provides a general interface for maps.
006     * @author R. Lunde
007     */
008    public interface Map {
009            
010            /** Returns a list of all locations. */
011            public List<String> getLocations();
012            
013            /**
014             * Answers to the question: Where can I get, following one of the
015             * connections starting at the specified location?
016             */
017            public List<String> getLocationsLinkedTo(String fromLocation);
018    
019            /**
020             * Returns the travel distance between the two specified locations if
021             * they are linked by a connection and null otherwise.
022             */
023            public Double getDistance(String fromLocation, String toLocation);
024    
025            /**
026             * Returns an array with two integers describing the the position of the
027             * specified location.
028             */
029            public Point2D getPosition(String loc);
030            
031            /**
032             * Returns a location which is selected by random.
033             */
034            public String randomlyGenerateDestination();
035    }