Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lab3GUI
Description
Graphical interface for the path finding lab.
Documentation
type Name = String
The name of a tram/bus stop.
type Cost = Int
The cost of a path, expressed in minutes.
type ShortestPath g = g -> Name -> Name -> Maybe ([Name], Cost)
A function to calculate the shortest path between two stops in a graph of type g. Returns the list of stops making up that path and the total cost of the path. Must return Nothing if no path could be found.
Arguments
:: [BStop] | A list of all list of nodes in the graph. |
-> [BLineTable] | All bus lines. |
-> graph | A value representing the graph; naming this type Graph or similar is probably a good idea. |
-> (graph -> Name -> Name -> Maybe ([Name], Cost)) | A function taking a graph, a start node and an end node, producing the list of nodes making up the shortest path from start to end and the total cost of that path. |
-> IO () |
Launch a travel planner GUI using a custom shortest path implementation. The GUI can be reached by pointing a web browser at http://localhost:8888.