Difference between revisions of "Part 3"
From CMSC 420
m (→Commands: replaced btree with bptree) |
m (→Data structures: more btree to bptree changes) |
||
Line 8: | Line 8: | ||
== Data structures == | == Data structures == | ||
− | # Data Dictionary (B | + | # Data Dictionary (B+ tree from part 2) |
#* Related commands: | #* Related commands: | ||
#** [[createCity]] | #** [[createCity]] | ||
Line 16: | Line 16: | ||
#** [[printBTree]] | #** [[printBTree]] | ||
#** [[nameRange]] | #** [[nameRange]] | ||
− | # Spatial Map (PM3 Quadtree | + | # Spatial Map (PM3 Quadtree from part 2) |
#* Related commands: | #* Related commands: | ||
#** [[mapRoad]] | #** [[mapRoad]] |
Revision as of 19:34, 10 June 2008
- Not Current for Summer 2007 or 2008 (We use B+ tree, not B tree)
- The official spec is not up yet.
- As always, the spec will freeze 1 week prior to the due date.
- Test Files
Overview[edit]
For this part of the project, you will implement a B+ Tree that implements the SortedMap interface with insertion and deletion. The B+ tree will become the new data dictionary. Depending on the input, the spatial map will use a PM1Quadtree, PM2Quadtree, or PM3Quadtree 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[edit]
- Data Dictionary (B+ tree from part 2)
- Related commands:
- Spatial Map (PM3 Quadtree from part 2)
- Related commands:
- Road Adjacency List
- Related commands:
Commands[edit]
The operations you will need to implement are in the spec:
- createCity/deleteCity: You will need to be able to add/remove cities to the data dictionary. No two cities can have the same coordinates or name.
- mapRoad/unmapRoad: Map/unmap 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.
- rangeRoads
- nearestCity: This finds the nearest city to a given point in the spatial map.
- nearestCityToRoad
- nearestRoad
- printBPTree: This outputs an XML representation of the data dictionary.
- 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.
- nameRange