One change we will be making is the addition of an id attribute to each <command> tag. This is just an integer that identifies the command; this should make it much easier to identify which input command is causing your output to differ from the correct output. You will simply copy the value of the id attribute in the input to an id attribute in the <command> tag of the corresponding output. The numbers below are just examples.
<success> <command name=''name1'' id=''1''/> <parameters> <param1 value=''value1''/> <param2 value=''value2''/> </parameters> <output/> </success>
This is the form (in the exact output order) of a general <error> tag. The <parameters> tag will always be present even if there are no parameters to the command. In each command there may be several errors; in this case you will only output the error of highest priority. For more information see XML Input specification for each command.
<error type=''error1''> <command name=''name1'' id=''2''/> <parameters> <param1 value=''value1''/> <param2 value=''value2''/> </parameters> </error>
<fatalError/>
<undefinedError />
Ordering of <city> tags that are contained within the <output> tag is in descending asciibetical order of the city's name according to the java.lang.String.comapreTo() method unless the method for sorting is specified within the command's specification.
Ordering of <road> tags that are contained within the <output> tag is in descending asciibetical order of the start city's name. If two roads have the same start city, the end city's names would appear in descending asciibetical order. The java.lang.String.compareTo() method is used unless the method of sorting is specified within the command's specification.
(none)Possible <output>:
A <quadtree> tag will be contained within output. This tag will have one attribute order which will be the PM order of the tree you are printing (this is given in the commands tag). 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 PM Quadtree follows. Remember, the exact structure of the quadtree will be represented by the XML output.
<gray x=''72'' y=''40''> ... </gray>
<black cardinality=''card''> ... </black>
mapIsEmpty<success> Example:
<success> <command name=''printPMQuadtree'' id=''1''/> <parameters/> <output> <quadtree order=''3''> <gray x=''128'' y=''128''> <black cardinality=''2''> <city color=''red'' name=''Berlin'' radius=''50'' x=''128'' y=''128'' /> <road end=''Geneva'' start=''Berlin'' /> </black> <black cardinality=''2''> <city color=''red'' name=''Berlin'' radius=''50'' x=''128'' y=''128'' /> <road end=''Geneva'' start=''Berlin'' /> </black> <gray x=''64'' y=''64''> <white /> <gray x=''96'' y=''96''> <white /> <black cardinality=''2''> <city color=''red'' name=''Berlin'' radius=''50'' x=''128'' y=''128'' /> <road end=''Geneva'' start=''Berlin'' /> </black> <black cardinality=''3''> <city color=''orange'' name=''Geneva'' radius=''80'' x=''90'' y=''70'' /> <road end=''Madrid'' start=''Geneva'' /> <road end=''Geneva'' start=''Berlin'' /> </black> <black cardinality=''2''> <isolatedCity color=''black'' name=''Paris'' radius=''10'' x=''50'' y=''30''/> <road end=''Geneva'' start=''Berlin'' /> </black> </gray> <black cardinality=''2''> <city color=''yellow'' name=''Madrid'' radius=''60'' x=''45'' y=''50'' /> <road end=''Madrid'' start=''Geneva'' /> </black> <black cardinality=''1''> <road end=''Madrid'' start=''Geneva'' /> </black> </gray> <black cardinality=''2''> <city color=''red'' name=''Berlin'' radius=''50'' x=''128'' y=''128'' /> <road end=''Geneva'' start=''Berlin'' /> </black> </gray> </quadtree> </output> </success>
Prints the Treap.
Treap are not deterministic so your output may vary from the sample files that we give you
Parameter:
(none)Possible <output>:
A <treap> node will be contained within the output tag and is the root of the Treap xml tree. This tag has one required attribute: cardinality, whose value should be the size (number of keys) held by the treap.
Possible <error> types:
emptyTree<success> Example:
<success> <command id=''4'' name=''printTreap''/> <parameters/> <output> <treap cardinality=''2''> <node key=''Baltimore'' priority=''844902938'' value=''(140,37)''> <node key=''Chicago'' priority=''-1294899492'' value=''(133,34)''> <emptyChild/> <emptyChild/> </node> <emptyChild/> </node> </treap> </output> </success>
The testing of your messages won't be as stringent as the fact that you reported a success in the first place. More precise information about what the messages are for each command is contained in the Input section of this document.
MM Hugue 2019-03-03