Skip to content
Snippets Groups Projects
Commit b5b0108b authored by Haley Glavina's avatar Haley Glavina
Browse files

uml state machine diagrams INgit add *git add *

parent 56947ede
No related branches found
No related tags found
No related merge requests found
File added
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" version="8.5.7" editor="www.draw.io" type="device"><diagram name="Page-1" id="74b105a0-9070-1c63-61bc-23e55f88626e">7V1bc5u4Hv80njnnoR0kQMBjknZ3O7PtdE66s7uPClZsujbyATlxzqc/EkgYJPnSGGRitw8NFvf/9fe/SEz8u+Xm1wKv5p/plCwm0JtuJv6HCYQgRoj/ESMvcgQEcT0yK7KpHNsO3Gf/I3LQk6PrbErKzoGM0gXLVt3BlOY5SVlnDBcFfe4e9kgX3buu8IwYA/cpXqjR9+F2/M9syuZyHIXBdsdvJJvN1c0BSuo9Dzj9Z1bQdS5vmdOc1HuWWF1HvmY5x1P63BryP078u4JSVm8tN3dkIUiriKbOYy/qSSf+7ZwtF/wH4JvV7l92nAyOOZm/WEFy1r7dzut5D16IcJIi3ycIpO98+XhPeLGWd7jN6LeCkPff8RPme/74/Dv//55hxknifcbpPFPEaT0WIxv+ALclK+g/5I4uaMHHKzL6t4/ZYqENtV7hkeZMShMM1G95YbH/iRQs42y+WWSznI8ts+lU7LzFciDl704KKzEk+cQlyKY1JInzK6FLwooXfojaG0p6vGi/n1sCFSZycN4SpkCOYSnGs+baW3bwDcmRXdwx6EqmXMjlT1qwOZ3RHC8+bkdvK7El4gpel7CcCsXLX3K8+vG3+MHVxL/9Thh7kVTHa0b50Pbqv1O62ilfSiLpukjlM8J6SDzqXhoXZIFZ9tTVYhu95Klfacbv2vDG9z2l4pI7EIXdizBczAiT52l0bx7kKFZAQy1M1iwW3LYJFjzPM0buV7giyDO3r11G4HJVG7zHbCMY1VGICfS96l8/AtzIkCKRRYB9i/j6vYhv0Kv8bjL2VyOx4tffhmTXuxrZ/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VktvmTv2LlcnUj01bh5bIssSjFU7yqIzdk7X9qCXcn0FVinQAd2VtsUDcSGLVI+UxLKAe5PLNEv9M7UA4H0jBLYj5vj5MQTorBnoJ2Y0fwbz0DpTRKuIXRiNkkcDaHV7FOZ31BvcpGmEmqiHUPfIYyD3kD5+hHVRuXMilHYyjgEGkRBwaGCWOxFh8452QBCb6B5rCOqjO6Qg7PUbRLw43KQIBdyAA2z3SzGIBCsuRhD5RNHvSKDPjXIcfc/D0yG0a0xqZYlDQ3BqSb2eC9mmULbgLZmYjgWyoS3uONNTBSPAl3rI8vaZwMW9KF7gACdi69lIX0IXNUSoWUh/a342j758DZENzGAi1vR9SzZmGYW/RWkYWKvO9kHWf3eYFkYlQe97kx9EmlM2KI4F/EdMNP026U9Wvn5hwLnFa6rF4KadDP2b8bAxIFLA2P5jMcXNaOTPlbiLZZsarAHm1d/JPyYwNuKRGOlrok8HFPXnKRgQpF8eiM+1LtVf+NLtIfBgEmB1vuFltdTYyd+PTTWPoyZ6GSrMYrx7dDDF/K0C/X4EVLL5z4uiysJivvhihmvx0lTtB2AM9CSwy5I/aXIVtQj5+tX1v3i14dLAr0kGKv1ZdoQyB/I+8JLVxagf0drW3f4UXUxL9U06Q+hLGZscFmcibzhGGNcqk/GmFPmfjLmuCsZnqpHtqiWiRZbPm5SsmJZtSosm3N25AajxgJlfdj16cjtYovw8LcdcLU9uZqvfMGu6NpT8j1FxfxnQSlrCz9/rflnjofEEf8H</diagram></mxfile>
\ No newline at end of file
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" version="8.5.6" editor="www.draw.io" type="device"><diagram name="Page-1" id="74b105a0-9070-1c63-61bc-23e55f88626e">5Vxbc5s4FP41ntl9SAZx5zFOk3ZnmplO3c62jwqWbbUYsUJOnP76lUBcJSdujbDj5KGFAwj8fUefjo4uE+d6vX1PYba6I3OUTGxrvp047ya2bfu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YKkJ4efIUZcnnzozTuQPxUu/KN9RihqSGfuNMaOBc19mlMS0Y7DGqGHZefMSAHcYVgK16g3Ji24d8VnzEg1UW4ImOWuCFzX1d968hMFgOhYGBnVMTQGeNy8HRWTRS0UNyIztqESMud2E+bxKPUu8nVgpO/QHJFZ21Cmvnyaz9nKCP2EOqFrXjFDPxdKplIhPO+31gI7VS62MOYGiLvh8tz+Qex30N0A41P33R9jIHKtT2r5Dj/CIW3iobWszzjAnRfrqNSrBqOuCga3mJvbdCqJR3Texz4C6FYTrazTb1FYQwDaybOikFEW3RdbBEcv+AKud29eyu4AbHVVD1KGanbuU6EQjPl/RqBcWVsT4KjGmll0DW53LKVvI/bd7oCjHv+B9cYPARK4H43d704n3TiDOdaDct6ncsFDinKAF08DPhEZMcw47b0S+FIJx4Q6Dtd8bq3dCVZ5DDdZgCKydI0fUI/QnbVWcS9vw4sxPm61sy05is12wc/M/</diagram></mxfile>
\ No newline at end of file
No preview for this file type
......@@ -104,16 +104,27 @@ The test dataset that will be used for purposes of this project is the \textit{U
The implementation involved over 30 classes implemented in Java. Additional JavaScript and html files were used to create a sophisticated user interface. For a description of each class and module used, Java documentation can be viewed at %INSERT JAVA DOC LINK%
\subsection{Class Organization}
The \textit{Trawl Expert} implementation efforts were divided into two subteams: Subteam A and Subteam B.
The following UML diagrams depict the organization and use-relations of all classes in the program. Two UML state machine diagrams are included to describe the states and transitions within the \textit{BioTree.java} and \textit{Main.java} class. Since the \textit{Main.java} class is a console version of the final server implementation, the states shown in its UML state machine diagram are analogous to the states of the final \textit{TrawlExpert} product.
% Include explanations of why we divided it into some of its main sections/classes
\begin{figure}[H]
\includegraphics[width=18cm, trim={6cm 0 6cm 0}, clip]{MainDotJava.pdf}
\caption{UML State machine diagram for \textit{Main.java}, a class that provides console access to the \textit{TrawlExpert}'s main functions. This class accepts search criteria from a user to produce a list of search results, depict a histogram of the records in that result, and compute a count of the search hits.}
\label{fig:Tree}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=18cm, trim={0 0 0 0}, clip]{BioTreeDotJava.pdf}
\caption{UML State machine diagram for \textit{/data/Biotree/BioTree.java}, a class that builds a tree-like data structure from the scientific name hierarchies of fish. }
\label{fig:Tree}
\end{figure}
\subsection{Maintaining Generality}
A common theme among \textit{TrawlExpert} classes is the use of lambda functions. Lambda functions provide the capacity for parameterized object comparison or parameterized value access. This maintains the generality, and therefore reusability, of each class by allowing for generic types in class definitions. Type(s) of the input(s) and the how input object(s) are used only become assigned when the function is used.
......@@ -126,16 +137,18 @@ The \textit{Field} interface can be found at \textit{/search/Field.java}. This i
\subsubsection{General Range}
The \textit{GeneralRange} interface can be found at \textit{/sort/GeneralRange.java}. This interface includes a \textit{isInBounds} function returns an integer to describe if a record is member to a subset of the search results. The input has a generic type, rather than \textit{Record} type, to satisfy reusability. The lambda function uses the range itself to perform conditional checks about whether the input object is below, within, or above the range. A return value of -1 indicates it is below, 0 indicates it is within, and 1 indicates it is above the range.
\section{Algorithmic Opportunities}
The \textit{TrawlExpert} was made possible by the use of vaious algorithms studied in \textit{SFWRENG 2C03: Algorithms} offered at McMaster University. These algorithms include \textit{Red-Black Tree} for searching and \textit{Merge Sort} for sorting objects. Additional algorithms outside of the course scope were implemented to optimize the program, they are described below.
The \textit{TrawlExpert} was made possible by the use of vaious algorithms studied in \textit{SFWRENG 2C03: Algorithms} offered at McMaster University. These algorithms include \textit{Red-Black Tree} for searching and \textit{Merge Sort} for sorting objects. Additional algorithms outside of the course scope were implemented to optimize the program; they are described below.
\subsection{Quick Select Algorithm}
A modified form of the \textit{Quick Sort} algorithm that returns the $k^{th}$ largest element of an unsorted array. Similar to \textit{Quick Sort}, \textit{Quick Select} randomly chooses a partitioning element to sort the array such that all elements smaller than the partition are left of it, and larger elements are to the right. However, rather than recursively sorting both halves of the partitioned array, \textit{Quick Select} only sorts the half containing the $k^{th}$ index. The algorithm terminates once the partitioning element ends up at the $k^{th}$ index of the array, the value of this element is returned.
This algorithm is implemented in \textit{/sort/QuickSelect.java}. It is used during the construction of \textit{k-d tree}s which require the frequent division of an array into two equally sized halves. By finding the median element of an array, it is partially sorted into equally sized small and large halves. The \textit{Quick Select} class implements a \textit{median} method to simplify its usage in \textit{k-d tree} construction.
Using \textit{Quick Select} rather than \textit{Merge Sort} has optimized the \textit{TrawlExpert}. When using \textit{Merge Sort} during \textit{k-d tree} construction, an array must be fully sorted before retrieving the median element. \textit{Quick Select} only partially sorts the array before reaching the median and has reduced \textit{k-d tree} construction from 40.083 s to 0.56 s
Using \textit{Quick Select} rather than \textit{Merge Sort} has drastically improved the \textit{TrawlExpert}'s performance. When using \textit{Merge Sort} during \textit{k-d tree} construction, an array must be fully sorted before retrieving the median element. \textit{Quick Select} only partially sorts the array before reaching the median and has reduced \textit{k-d tree} construction from 40.083 s using \textit{Merge Sort} to 0.56 s.
% Mention optimization for Worms API
......
......@@ -5,11 +5,11 @@
\contentsline {section}{\numberline {2}Implementation}{5}{section.2}
\contentsline {subsection}{\numberline {2.1}Classes and Modules}{5}{subsection.2.1}
\contentsline {subsection}{\numberline {2.2}Class Organization}{5}{subsection.2.2}
\contentsline {subsection}{\numberline {2.3}Maintaining Generality}{6}{subsection.2.3}
\contentsline {subsubsection}{\numberline {2.3.1}General Compare}{6}{subsubsection.2.3.1}
\contentsline {subsubsection}{\numberline {2.3.2}Field}{6}{subsubsection.2.3.2}
\contentsline {subsubsection}{\numberline {2.3.3}General Range}{7}{subsubsection.2.3.3}
\contentsline {section}{\numberline {3}Algorithmic Opportunities}{7}{section.3}
\contentsline {subsection}{\numberline {3.1}Quick Select Algorithm}{7}{subsection.3.1}
\contentsline {subsection}{\numberline {3.2}K-d Tree Algorithm}{7}{subsection.3.2}
\contentsline {subsection}{\numberline {3.3}Graph Algorithms}{7}{subsection.3.3}
\contentsline {subsection}{\numberline {2.3}Maintaining Generality}{7}{subsection.2.3}
\contentsline {subsubsection}{\numberline {2.3.1}General Compare}{7}{subsubsection.2.3.1}
\contentsline {subsubsection}{\numberline {2.3.2}Field}{7}{subsubsection.2.3.2}
\contentsline {subsubsection}{\numberline {2.3.3}General Range}{8}{subsubsection.2.3.3}
\contentsline {section}{\numberline {3}Algorithmic Opportunities}{8}{section.3}
\contentsline {subsection}{\numberline {3.1}Quick Select Algorithm}{8}{subsection.3.1}
\contentsline {subsection}{\numberline {3.2}K-d Tree Algorithm}{8}{subsection.3.2}
\contentsline {subsection}{\numberline {3.3}Graph Algorithms}{8}{subsection.3.3}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment