Changes

2,092 bytes added ,  23:47, 18 March 2007
new part 2 page based on current draft
* Due Date: April ? (+ epsilon)
* The official spec is not up yet.
* As always, the spec will freeze 1 week prior to the due date.

== Overview ==
For this part of the project, you will implement a [http://en.wikipedia.org/wiki/B-tree B-Tree] that implements the [http://java.sun.com/j2se/1.5.0/docs/api/java/util/SortedMap.html SortedMap] interface. However, you do not need to implement deletion operations until [[Part 3]]. The B-tree will become the new data dictionary. The spatial map will now use a [[PM3 Quadtree]] to store both cities and roads. You will also be required to make a road adjacency list for use in finding the shortest path between two cities.

== Data structures ==
# Data Dictionary (B-tree for part 2)
#* Related commands:
#** [[createCity]]
#** [[listCities]]
#** [[clearAll]]
#** [[printBTree]]
# Spatial Map (PM3 Quadtree for part 2)
#* Related commands:
#** [[mapRoad]]
#** [[rangeCities]]
#** [[nearestCity]]
#** [[saveMap]]
#** [[clearAll]]
# Road Adjacency List
#* Related commands:
#** [[shortestPath]]

== Commands ==
The operations you will need to support can be gleaned from the spec:

* [[createCity]]: You will need to be able to add cities to the data dictionary. No two cities can have the same coordinates or name.
* [[mapRoad]]: Map a road in the spatial map.
* [[listCities]]: Output a sorted (XML) list of cities in the data dictionary.
* [[rangeCities]]: This searches the spatial data structure for all cities within a given radius of a given point. Optionally save a visual representation of the command to an image file.
* [[nearestCity]]: This finds the nearest city to a given point in the spatial map.
* [[printPMQuadtree]]: This outputs an XML (textual) representation of the spatial map.
* [[saveMap]]: This outputs a visual representation (an image) of the spatial data structure. See [[CanvasPlus]].
* [[clearAll]]: Clears all of the data structures, removing all elements.
* [[shortestPath]]: Computes the shortest path between two cities. Optionally saves the path to an image file or generates an HTML file for the shortest path.
103

edits