PrintPRQuadtree

From CMSC 420
Revision as of 00:12, 11 September 2013 by Rforsythe (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Prints the PR quadtree. Since PR quadtrees are deterministic, your XML should match exactly the primary input/output.

Parameters[edit]

  • (None)

Possible <output>[edit]

A <quadtree> tag will be contained within output and will contain several <gray> <white> and <black> nodes. The first node in the quadtree will be the root node, this node can be gray or black, then the rest of the PR Quadtree follows. Remember, the exact structure of the quadtree will be represented by the XML output.

<gray>

  • Nodes will contain 4 children nodes with ordering decided by the order of the nodes within the actual gray node in your PR Quad Tree.<gray> nodes will have the attributes x and y, these are integers that identify the location of the grey node. They will appear as such:

   <gray x="72" y="40">
       ...
   </gray>

<black>

  • Nodes represent a mapped city in your PR Quadtree, they have the attributes name, x and y. These will identify the city name and location of the black node, and will appear as such:

   <black name="Chicago" x="81" y="47"/>

<white>

  • Nodes represent an empty node in your PR Quadtree and will appear as such:

   <white/>

Possible <error> types[edit]

  • mapIsEmpty

<success> Example[edit]

   <success>
       <command name="printPRQuadtree"/>
       <parameters/>
       <output>
           <quadtree>
               <gray x="64" y="64">
                   <white/>
                   <white/>
                   <white/>
                   <gray x="96" y="32">
                       <gray x="80" y="48">
                           <white/>
                           <white/>
                           <gray x="72" y="40">
                               <black name="Boston" x="71" y="42"/>
                               <white/>
                               <white/>
                               <black name="Baltimore" x="76" y="39"/>
                           </gray>
                           <gray x="88" y="40">
                               <black name="Chicago" x="81" y="47"/>
                               <white/>
                               <black name="Atlanta" x="84" y="33"/>
                               <white/>
                           </gray>
                       </gray>
                       <black name="Los_Angeles" x="118" y="33"/>
                       <black name="Miami" x="80" y="25"/>
                       <white/>
                   </gray>
               </gray>
           </quadtree>
       </output>
   </success>