<success> message.
If the B+ tree order has already been initialized,
then you should print the <error> message.
Note:
Even if you don't implement the B+ tree, and must submit using the treemap
from Part 1, you must still implement this
function, printing
the appropriate <success> message. Because this is always
the first command and diff is used in grading, if you skip this function your
project will fail every test!
Output summary: <output>:=<success>|<error> <success>:=Initialized B+ trees to order <order>.<nl> <error>:=<BPTreesAlreadyInitialized>|<InvalidBPTreeOrder>
Output summary: <output>:=mission complete<nl>
Output summary: <output>:=sites cleared<nl>
<success> message.
If there is a object in the dictionary with the same name, you
should print the <SiteAlreadyExists> error message.
Duplicate data can exist between the seperate data dictionarys.
For example, you can have a "Gerogia" base in your friendly data
dictionary and a "Gerogia" base in your enemy data dictionary.
Note that the sorted object order is asciibetically by their
case insensitive name. This should be an O(log n) operation if you have
implemented your data dictionary correctly.
Output summary: <output>:= <success>|<error> <success>:=created friendly site <Site>.<nl> <error>:=<SiteAlreadyExists>
<success> message.
If there is a object in the dictionary with the same name, you
should print the <SiteAlreadyExists> error message.
Duplicate data can exist between the separate data dictionarys.
For example, you can have an "Alexandria'' Air unit in both your
Friendly and Enemy data dictionaries.
Note that the sorted object order is asciibetically by their
case insensitive name. This should be an O(log n) operation if you have
implemented your data dictionary correctly.
Output summary: <output>:= <success>|<error> <success>:=created enemy site <Site>.<nl> <error>:=<SiteAlreadyExists>
DELETE_SITE or DELETE_DATA in Part 2 should result in
the <InvalidCommand> error message.
<NoSitesEntered> message.
If there are sites in the dictionary, print them as described below. Note that
site names are case insensitive so if the name of one site was "baltimore"
and another site was named "Reno" then "Reno" would be printed before
"baltimore" (since "R" comes before "b" in the ASCII character set).
Dictionary Types: F - Friendly E - Enemy
Output summary: <output>:=<SiteList>|<NoSitesEntered> <SiteList>:=<Site><nl><SiteList>|<Site><nl> <NoSitesEntered>:=No sites have been entered into the dictionary.<nl>
The output is formatted so that each level of the tree is enclosed in braces {}; each node is enclosed in parentheses; guide values in each internal node are separated by commas; key values within leaf nodes are separated commas. Each level of the tree should appear on its own line and in order. Thus, a tree of order three (3) with five keys (names of sites) might look like this:
{(Bowie)}
{(Baltimore) (CollegePark)}
{(Annapolis,Baltimore) (Bowie) (CollegePark, HolyCross)}
Note that by convention, the leaf containing the key ``CollegePark'' (the key of the object of type ``civilian territory'' with site name ``CollegePark'') is a right child of the internal node containing the guide value ``CollegePark''. That is, we have a rule for dealing with equal guide and key values.
Even at the leaves print only the key (the site name). If the data dictionary
is empty, print the <NoSitesEntered> message. Your tree is not expected to match
ours exactly. Your grade will be based on your tree displaying the properties
described above in the INIT_BPTREE command.
For our order m tree: The leaves contain between 1 and m-1 keys, inclusive. They may not have m keys. Internal node must have between ceiling(m/2) and m children, inclusive. For each internal node, the number of guide values printed must be one less than number of child nodes, meaning that (no 'extra' key on the far left should be printed, even if you used one in your implementation. Your tree, of course, must also contain the correct data at the leaves!
Output summary:
<output>:=<success>|<error>
<success>:=<b+rows><nl>
<b+rows>:=<b+row><nl><b+rows>|<b+row>
<b+row>:={<nodes>}
<nodes>:=<node>,<nodes>|<node>
<node>:=(<keys>)
<keys>:=<key>,<keys>|<key>
<key>:=<SiteName>
<error>:=<NoSitesEntered>
<success> message.
Note, there is only one spatial data structure for both friendly and enemy sites.
If the site could not be
found, print the <SiteDoesNotExist> error message.
If the site was found but a site was already mapped to the same coordinates
(either the same site or a site with a different name but the same coordinates),
print the <SiteAlreadyMapped> error message using the site which is
already mapped in the spatial data structure. Please note that this may or
may not be the same site that was specified as a parameter. For instance, if
the site "Buda at (600,600)" is already in the map and we attempted to map
"Pest at (600,600)" then we would get the error message "Error: The site
Buda at (600,600) has already been mapped at those coordinates."
Recall that both latitude and longitude are integers in the range [0, 1024). This should be an O(log n) operation.
Dictionary Types: F - Friendly E - Enemy
Output summary: <output>:=<success>|<error> <success>:=Mapped site <Site>.<nl> <error>:=<SiteDoesNotExist>|<SiteAlreadyMapped>
<SiteDoesNotExist> error message. If the site does exist, you should
search the spatial data structure for a site with the specified name. If
the site cannot be found in the spatial data structure because it was not mapped,
print the <SiteNotMapped> error message. If the site has been mapped, then delete the site from the
map/spatial data
structure and print the <success> message. This should be an O(log n)
operation.
Dictionary Types: F - Friendly E - Enemy
Output summary: <output>:=<success>|<error> <success>:=Unmapped site <site>.<nl> <error>:=<SiteDoesNotExist>|<SiteNotMapped>
NW military base: Baltimore at (0,1000)
NE
SW
SE hospital: HolyCross is at (1000,0)
If the military base (Bowie,500,600) were added, the output would look like:
NW
NW military base: Baltimore at (0,1000)
NE
SW
SE military base: Bowie at (500,600)
NE
SW
SE hospital: HolyCross at (1000,0)
Output summary: <output>:=<success>|<error> <success>:= <grey_node><nl> <prtree>:=<black_node><nl>|<white_node><nl>|<nl><grey_node> <grey_node>:= NW <prtree> NE <prtree> SW <prtree> SE <prtree> <black_node>:=<Site><nl> <white_node>:= <error>:= No matching sites found.<nl>
<success> message.
Although you are welcome to make use of any drawing
mechanisms in JAVA, we recommend that you use the CanvasPlus drawing
package on the class web page which was written specifically to support this feature.
Please use common sense in rendering your picture to a size that fits on an average size screen(1024x768 max). It is understood the small quadrants will be difficult to see in the picture, this is ok. We will only be eye-balling your drawing during grading; so, as long as you have a picture that represents the mapped cities and the roads somewhat correctly we'll be happy.
Note that this function is primarily to help *you* debug your code. It will be very helpful
in Part 2 to help you determine if your UNMAP_SITE function is working correctly and it
will become an invaluable debugging tool for your PM1 quadtree in Parts 3 and 4.
Output summary: <output>:=<success> <success>:=Drawing complete.<nl>