next up previous
Next: Part 3 Point Breakdown: TBD Up: Optional and Extra Credit Previous: Optimized Shortest Path, and

The Optional Commands

As before, assistance in fleshing these out will be rewarded.

REMOVE_TRACK(startLocus,destinationLocus)
This command takes two (2) parameters: the start and destination loci as case insensitive strings. If either startLocus or destinationLocus does not exist, print the <LocusDoesNotExist> error message (note that the startLocus erro message takes precidence over the destinationLocus error message. If there is a track in the spatial data structure that connects startLocus to destinationLocus, remove the track from the spatial data structure and from the adjacency list and print the <success> message. If there is not track connecting startLocus to destinationLocus, print the <TrackDoesNotExist> error message. Remember that you will need to ensure that your PM1 quadtree adheres to the minimal node rule after each delete operation.

Output summary:
<output>:=<success>|<error>
<success>:=Removed track <Track><nl>
<error>:=<LocusDoesNotExist>|<TrackDoesNotExist>

REMOVE_SITE(SiteName)
This command takes one (1) parameter: the name of the site to be removed as a case insensitive strings. If site <SiteName> does not exist, print the <SiteDoesNotExist> error message. If site <SiteName> has not been mapped, print the <SiteNotMapped> error message.

If site <SiteName> has been mapped, remove it from the PM1 quadtree. Remember that you will need to ensure that your PM1 quadtree adheres to the minimal node rule after each delete operation.

Output summary:
<output>:=<success>|<error>
<success>:=Removed site <SiteName><nl>
<error>:=<SiteDoesNotExist>|<SiteNotMapped>

BEST_ROUTE(startLocus, destinationLocus)
This command takes two parameters: the name of the start and destination loci as case insensitive strings. This command should find the best (lowest cost) route, based on the sum of the weights of the tracks between the two loci The route should be printed along with the total weight of the route. using the <success> message format. If either locus is not in the dictionary, print the <LocusDoesNotExist> error message. If either locus is not in the map, print the <LocusNotMapped> error message. As with the INSERT_TRACK command, startLocus error messages take precedence over destinationLocus error messages. If there is no route to connect the two sites, print the <NoRouteExists> error message using the locus objects found from the data dictionary that match the specified locus names. Note that this should be implemented using the Fibonacci heap implementation of a priority queue for Dijkstra's algorithm.

Output summary: 
<output>:=<success>|<error> 
<success>:=<Route>
<error>:=<StartAndDestinationSame>|<LocusDoesNotExist>|<LocusNotMapped>|<NoRouteExists>

SPAN_LOCI(StartName, EndName)
TBD. This is a range search in the B+ tree. The names of all Loci witha names in the closed interval determined by the StartName and EndName should be printed.

Dear Anyone, Please feel free to write a BNF for this, too. Your aid will not go unnoticed.

NEAREST_LOCUS(LocusType, longitude, latitude)
This command takes three arguments-a LocusType, indicating the type of locus of interest, and coordinates <longitude,latitude>. The command returns the name of the locus of the specified type in the map that is closest to position <longitude,latitude>. If the LocusType is not valid, output the <InvalidLocusType>.

Output summary:
<output>:=<success>|<error>
<success>:=<LocusName>| No Loci of <LocusType>  Present<nl>
<error>:=<InvalidLocusType>

NEAREST_TRACK(longitude, latitude):
Description to appear. Output should be description of track as it was inserted-using endpoints and direction.

Voluteers solicited to fill this one out, too. Description and BNF.


next up previous
Next: Part 3 Point Breakdown: TBD Up: Optional and Extra Credit Previous: Optimized Shortest Path, and
MM Hugue 2004-04-19